From 18ff8886321229ff8f8bca3ef46255d84a0b2ca1 Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 8 Apr 2024 06:29:02 +0900 Subject: [PATCH] chore(tls): Update to rustls-0.23 --- tonic/Cargo.toml | 5 ++--- tonic/src/transport/service/tls.rs | 7 +++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tonic/Cargo.toml b/tonic/Cargo.toml index 99388e357..1ab43a11e 100644 --- a/tonic/Cargo.toml +++ b/tonic/Cargo.toml @@ -28,7 +28,7 @@ gzip = ["dep:flate2"] zstd = ["dep:zstd"] default = ["transport", "codegen", "prost"] prost = ["dep:prost"] -tls = ["dep:rustls-pki-types", "dep:rustls-pemfile", "transport", "dep:tokio-rustls", "dep:tokio", "tokio?/rt", "tokio?/macros"] +tls = ["dep:rustls-pemfile", "transport", "dep:tokio-rustls", "dep:tokio", "tokio?/rt", "tokio?/macros"] tls-roots = ["tls-roots-common", "dep:rustls-native-certs"] tls-roots-common = ["tls"] tls-webpki-roots = ["tls-roots-common", "dep:webpki-roots"] @@ -77,10 +77,9 @@ axum = {version = "0.6.9", default_features = false, optional = true} # rustls async-stream = { version = "0.3", optional = true } -rustls-pki-types = { version = "1.0", optional = true } rustls-pemfile = { version = "2.0", optional = true } rustls-native-certs = { version = "0.7", optional = true } -tokio-rustls = { version = "0.25", optional = true } +tokio-rustls = { version = "0.26", default-features = false, features = ["logging", "tls12", "ring"], optional = true } webpki-roots = { version = "0.26", optional = true } # compression diff --git a/tonic/src/transport/service/tls.rs b/tonic/src/transport/service/tls.rs index 96e1fe652..11dd554ca 100644 --- a/tonic/src/transport/service/tls.rs +++ b/tonic/src/transport/service/tls.rs @@ -3,10 +3,13 @@ use std::{ {fmt, sync::Arc}, }; -use rustls_pki_types::{CertificateDer, PrivateKeyDer, ServerName}; use tokio::io::{AsyncRead, AsyncWrite}; use tokio_rustls::{ - rustls::{server::WebPkiClientVerifier, ClientConfig, RootCertStore, ServerConfig}, + rustls::{ + pki_types::{CertificateDer, PrivateKeyDer, ServerName}, + server::WebPkiClientVerifier, + ClientConfig, RootCertStore, ServerConfig, + }, TlsAcceptor as RustlsAcceptor, TlsConnector as RustlsConnector, };