Remove root certificate loading in client

This commit is contained in:
Michael Pfaff 2023-06-06 23:37:40 -04:00
parent 545ec4ebc4
commit b538e148d1
Signed by: michael
GPG Key ID: CF402C4A012AA9D4
1 changed files with 0 additions and 16 deletions

View File

@ -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();