Remove root certificate loading in client
This commit is contained in:
parent
545ec4ebc4
commit
b538e148d1
16
src/main.rs
16
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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue