chore: Update to rustls 0.21 (#1340)

This commit is contained in:
tottoto
2023-04-03 13:30:18 +00:00
committed by GitHub
parent 893249e216
commit 5bcebaf3ca
4 changed files with 9 additions and 8 deletions
+2 -2
View File
@@ -80,8 +80,8 @@ axum = {version = "0.6.9", default_features = false, optional = true}
async-stream = { version = "0.3", optional = true }
rustls-pemfile = { version = "1.0", optional = true }
rustls-native-certs = { version = "0.6.1", optional = true }
tokio-rustls = { version = "0.23.1", optional = true }
webpki-roots = { version = "0.22.1", optional = true }
tokio-rustls = { version = "0.24.0", optional = true }
webpki-roots = { version = "0.23.0", optional = true }
# compression
flate2 = {version = "1.0", optional = true}
+4 -3
View File
@@ -128,14 +128,15 @@ impl TlsAcceptor {
use tokio_rustls::rustls::server::AllowAnyAnonymousOrAuthenticatedClient;
let mut roots = RootCertStore::empty();
rustls_keys::add_certs_from_pem(std::io::Cursor::new(&cert.pem[..]), &mut roots)?;
builder
.with_client_cert_verifier(AllowAnyAnonymousOrAuthenticatedClient::new(roots))
builder.with_client_cert_verifier(
AllowAnyAnonymousOrAuthenticatedClient::new(roots).boxed(),
)
}
(Some(cert), false) => {
use tokio_rustls::rustls::server::AllowAnyAuthenticatedClient;
let mut roots = RootCertStore::empty();
rustls_keys::add_certs_from_pem(std::io::Cursor::new(&cert.pem[..]), &mut roots)?;
builder.with_client_cert_verifier(AllowAnyAuthenticatedClient::new(roots))
builder.with_client_cert_verifier(AllowAnyAuthenticatedClient::new(roots).boxed())
}
};