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
+1 -1
View File
@@ -52,7 +52,7 @@ license-files = [
] ]
[[licenses.clarify]] [[licenses.clarify]]
name = "webpki" name = "rustls-webpki"
expression = "ISC" expression = "ISC"
license-files = [ license-files = [
{ path = "LICENSE", hash = 0x001c7e6c }, { path = "LICENSE", hash = 0x001c7e6c },
+2 -2
View File
@@ -306,8 +306,8 @@ warp = { version = "0.3.4", default-features = false, optional = true }
listenfd = { version = "1.0", optional = true } listenfd = { version = "1.0", optional = true }
bytes = { version = "1", optional = true } bytes = { version = "1", optional = true }
h2 = { version = "0.3", optional = true } h2 = { version = "0.3", optional = true }
tokio-rustls = { version = "0.23", optional = true } tokio-rustls = { version = "0.24.0", optional = true }
hyper-rustls = { version = "0.23", features = ["http2"], optional = true } hyper-rustls = { version = "0.24.0", features = ["http2"], optional = true }
rustls-pemfile = { version = "1", optional = true } rustls-pemfile = { version = "1", optional = true }
tower-http = { version = "0.4", optional = true } tower-http = { version = "0.4", optional = true }
+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 } async-stream = { version = "0.3", optional = true }
rustls-pemfile = { version = "1.0", optional = true } rustls-pemfile = { version = "1.0", optional = true }
rustls-native-certs = { version = "0.6.1", optional = true } rustls-native-certs = { version = "0.6.1", optional = true }
tokio-rustls = { version = "0.23.1", optional = true } tokio-rustls = { version = "0.24.0", optional = true }
webpki-roots = { version = "0.22.1", optional = true } webpki-roots = { version = "0.23.0", optional = true }
# compression # compression
flate2 = {version = "1.0", optional = true} flate2 = {version = "1.0", optional = true}
+4 -3
View File
@@ -128,14 +128,15 @@ impl TlsAcceptor {
use tokio_rustls::rustls::server::AllowAnyAnonymousOrAuthenticatedClient; use tokio_rustls::rustls::server::AllowAnyAnonymousOrAuthenticatedClient;
let mut roots = RootCertStore::empty(); let mut roots = RootCertStore::empty();
rustls_keys::add_certs_from_pem(std::io::Cursor::new(&cert.pem[..]), &mut roots)?; rustls_keys::add_certs_from_pem(std::io::Cursor::new(&cert.pem[..]), &mut roots)?;
builder builder.with_client_cert_verifier(
.with_client_cert_verifier(AllowAnyAnonymousOrAuthenticatedClient::new(roots)) AllowAnyAnonymousOrAuthenticatedClient::new(roots).boxed(),
)
} }
(Some(cert), false) => { (Some(cert), false) => {
use tokio_rustls::rustls::server::AllowAnyAuthenticatedClient; use tokio_rustls::rustls::server::AllowAnyAuthenticatedClient;
let mut roots = RootCertStore::empty(); let mut roots = RootCertStore::empty();
rustls_keys::add_certs_from_pem(std::io::Cursor::new(&cert.pem[..]), &mut roots)?; 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())
} }
}; };