From b112a13f4ed489aa15d9731b35e5a1ed9467a4f7 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 9 Nov 2024 03:20:18 +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 4f21d8fd91..66d22336c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1368,7 +1368,6 @@ dependencies = [ "regex", "rusqlite", "rust-hsluv", - "rustls", "rustls-pki-types", "sanitize-filename", "serde", diff --git a/Cargo.toml b/Cargo.toml index b22863e063..94d763ecce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,7 +86,6 @@ regex = { workspace = true } rusqlite = { workspace = true, features = ["sqlcipher"] } rust-hsluv = "0.1" rustls-pki-types = "1.10.0" -rustls = { version = "0.23.14", default-features = false } sanitize-filename = { workspace = true } serde_json = { workspace = true } serde_urlencoded = "0.7.1" diff --git a/src/net/tls.rs b/src/net/tls.rs index 183ad75319..e8a62d11ab 100644 --- a/src/net/tls.rs +++ b/src/net/tls.rs @@ -35,10 +35,10 @@ pub async fn wrap_rustls( alpn: &[&str], stream: impl SessionStream, ) -> 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();