eclipse-opendut / opendut

Test Electronic Control Units around the world in a transparent network.
https://opendut.eclipse.dev
Apache License 2.0
25 stars 15 forks source link

CARL's client to communicate to the Netbird Management API should provide more configuration options #68

Closed kKdH closed 9 months ago

kKdH commented 9 months ago

The client used by CARL to communicate to the Netbird Management API should provide more configuration parameters:

The existing config files should be adjusted to reflect these changes and should provide sensible default values.

mbfm commented 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.");
kKdH commented 9 months ago

~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~

kKdH commented 9 months ago

Updated issue #70 to allow different CA certificates and same applies to this one.

reimarstier commented 9 months ago

Open tasks are addressed in new issue #95.