Closed kKdH closed 9 months ago
Example code changes for loading the certificate in opendut-vpn/opendut-vpn-netbird/src/client/mod.rs
:
+ const CERT_PATH: &str = "/etc/opendut-network/tls/ca.pem"; //TODO config
+ debug!("Loading certificate from: {CERT_PATH}");
+ let mut buffer = Vec::new();
+ File::open(CERT_PATH).unwrap()
+ .read_to_end(&mut buffer).unwrap();
+ let cert = Certificate::from_pem(&buffer).unwrap();
+
let client = reqwest::Client::builder()
.default_headers(headers)
.https_only(false) // this is only required for theo's netbird setup and should be changed to use https only.
+ .add_root_certificate(cert)
.build()
.expect("Failed to construct client.");
~Is it always the same CA certificate? To be more precise the same CA certificate used for CARL and Netbird? If so, then we should load it in CARL and pass it down to the vpn client, because we use the same cert for #70~
Updated issue #70 to allow different CA certificates and same applies to this one.
Open tasks are addressed in new issue #95.
The client used by CARL to communicate to the Netbird Management API should provide more configuration parameters:
https_only=false
, so the corresponding configs incarl.toml
, THEO etc. can be removed.The existing config files should be adjusted to reflect these changes and should provide sensible default values.