From 0ab10f99fd4fa63c172381033917dc108e358916 Mon Sep 17 00:00:00 2001 From: link2xt Date: Mon, 13 Oct 2025 16:46:48 +0000 Subject: [PATCH] refactor: use rustls reexported from tokio_rustls --- Cargo.lock | 1 - Cargo.toml | 1 - src/net/tls.rs | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 58addcd65..87cbbbb86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1346,7 +1346,6 @@ dependencies = [ "ratelimit", "regex", "rusqlite", - "rustls", "rustls-pki-types", "sanitize-filename", "sdp", diff --git a/Cargo.toml b/Cargo.toml index 5fcaa495f..f8c2cd95a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -87,7 +87,6 @@ rand = { workspace = true } regex = { workspace = true } rusqlite = { workspace = true, features = ["sqlcipher"] } rustls-pki-types = "1.12.0" -rustls = { version = "0.23.22", default-features = false } sanitize-filename = { workspace = true } sdp = "0.8.0" serde_json = { workspace = true } diff --git a/src/net/tls.rs b/src/net/tls.rs index 1c9eb5a90..94b43233f 100644 --- a/src/net/tls.rs +++ b/src/net/tls.rs @@ -35,10 +35,10 @@ pub async fn wrap_rustls<'a>( alpn: &[&str], stream: impl SessionStream + 'a, ) -> Result { - let mut root_cert_store = rustls::RootCertStore::empty(); + let mut root_cert_store = tokio_rustls::rustls::RootCertStore::empty(); root_cert_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); - let mut config = rustls::ClientConfig::builder() + let mut config = tokio_rustls::rustls::ClientConfig::builder() .with_root_certificates(root_cert_store) .with_no_client_auth(); config.alpn_protocols = alpn.iter().map(|s| s.as_bytes().to_vec()).collect();