From 2c72d0f1835fa8ddf2927f5fce366c7c8cb42fab Mon Sep 17 00:00:00 2001 From: tottoto Date: Sun, 2 Apr 2023 16:40:16 +0900 Subject: [PATCH] chore: Update to rustls 0.21 --- deny.toml | 2 +- examples/Cargo.toml | 4 ++-- tonic/Cargo.toml | 4 ++-- tonic/src/transport/service/tls.rs | 7 ++++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/deny.toml b/deny.toml index aea2fb0de..9b3f7e180 100644 --- a/deny.toml +++ b/deny.toml @@ -52,7 +52,7 @@ license-files = [ ] [[licenses.clarify]] -name = "webpki" +name = "rustls-webpki" expression = "ISC" license-files = [ { path = "LICENSE", hash = 0x001c7e6c }, diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 2a378ff4e..e51e69c05 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -306,8 +306,8 @@ warp = { version = "0.3", default-features = false, optional = true } listenfd = { version = "1.0", optional = true } bytes = { version = "1", optional = true } h2 = { version = "0.3", optional = true } -tokio-rustls = { version = "0.23", optional = true } -hyper-rustls = { version = "0.23", features = ["http2"], optional = true } +tokio-rustls = { version = "0.24.0", optional = true } +hyper-rustls = { version = "0.24.0", features = ["http2"], optional = true } rustls-pemfile = { version = "1", optional = true } tower-http = { version = "0.4", optional = true } diff --git a/tonic/Cargo.toml b/tonic/Cargo.toml index 0876d1bd6..30d28be55 100644 --- a/tonic/Cargo.toml +++ b/tonic/Cargo.toml @@ -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} diff --git a/tonic/src/transport/service/tls.rs b/tonic/src/transport/service/tls.rs index 19eaa8e55..422097a28 100644 --- a/tonic/src/transport/service/tls.rs +++ b/tonic/src/transport/service/tls.rs @@ -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()) } };