Fix deprecation warning, massage connection verifier function somewhat

This commit is contained in:
Nathan Fisher 2023-08-18 23:03:24 -04:00
parent 317672991e
commit ca942d6e3e
2 changed files with 4 additions and 1 deletions

View file

@ -47,7 +47,10 @@ impl<S: FingerPrintStore> ClientCertVerifier for Verifier<S> {
return Err(rustls::Error::InvalidCertificate( return Err(rustls::Error::InvalidCertificate(
rustls::CertificateError::NotValidForName, rustls::CertificateError::NotValidForName,
)); ));
} else {
return Ok(ClientCertVerified::assertion());
} }
} else {
} }
} }
todo!() todo!()

View file

@ -75,7 +75,7 @@ where
let rustls_cert = rustls::Certificate(c.der); let rustls_cert = rustls::Certificate(c.der);
let cert_chain = vec![rustls_cert]; let cert_chain = vec![rustls_cert];
let key_der = rustls::PrivateKey(c.key); let key_der = rustls::PrivateKey(c.key);
cfg.with_single_cert(cert_chain, key_der)? cfg.with_client_auth_cert(cert_chain, key_der)?
} }
}; };
let client = ClientConnection::new(Arc::new(cfg), dnsname)?; let client = ClientConnection::new(Arc::new(cfg), dnsname)?;