From b538e148d15fdad74d00217d7284445dd1d8aab4 Mon Sep 17 00:00:00 2001 From: Michael Pfaff Date: Tue, 6 Jun 2023 23:37:40 -0400 Subject: [PATCH] Remove root certificate loading in client --- src/main.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/main.rs b/src/main.rs index ff656a9..88376df 100644 --- a/src/main.rs +++ b/src/main.rs @@ -535,24 +535,8 @@ async fn run_client(mut args: std::env::Args) -> Result<()> { let conn_str = args.next().expect("USERNAME@HOST"); let (username, host) = conn_str.split_once('@').expect("USERNAME@HOST"); - let mut roots = rustls::RootCertStore::empty(); - match std::fs::read("cert.der") { - Ok(cert) => { - roots.add(&rustls::Certificate(cert))?; - } - Err(ref e) if e.kind() == std::io::ErrorKind::NotFound => { - info!("local server certificate not found"); - } - Err(e) => { - error!("failed to open local server certificate: {}", e); - } - } - - info!("read roots"); - let mut client_crypto = rustls::ClientConfig::builder() .with_safe_defaults() - //.with_root_certificates(roots) .with_custom_certificate_verifier(Arc::new(InformedServerCertVerifier { cfg }) as _) .with_no_client_auth();