mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
refactor: use rustls reexported from tokio_rustls
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -1346,7 +1346,6 @@ dependencies = [
|
|||||||
"ratelimit",
|
"ratelimit",
|
||||||
"regex",
|
"regex",
|
||||||
"rusqlite",
|
"rusqlite",
|
||||||
"rustls",
|
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
"sanitize-filename",
|
"sanitize-filename",
|
||||||
"sdp",
|
"sdp",
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ rand = { workspace = true }
|
|||||||
regex = { workspace = true }
|
regex = { workspace = true }
|
||||||
rusqlite = { workspace = true, features = ["sqlcipher"] }
|
rusqlite = { workspace = true, features = ["sqlcipher"] }
|
||||||
rustls-pki-types = "1.12.0"
|
rustls-pki-types = "1.12.0"
|
||||||
rustls = { version = "0.23.22", default-features = false }
|
|
||||||
sanitize-filename = { workspace = true }
|
sanitize-filename = { workspace = true }
|
||||||
sdp = "0.8.0"
|
sdp = "0.8.0"
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
|
|||||||
@@ -35,10 +35,10 @@ pub async fn wrap_rustls<'a>(
|
|||||||
alpn: &[&str],
|
alpn: &[&str],
|
||||||
stream: impl SessionStream + 'a,
|
stream: impl SessionStream + 'a,
|
||||||
) -> Result<impl SessionStream + 'a> {
|
) -> Result<impl SessionStream + 'a> {
|
||||||
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());
|
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_root_certificates(root_cert_store)
|
||||||
.with_no_client_auth();
|
.with_no_client_auth();
|
||||||
config.alpn_protocols = alpn.iter().map(|s| s.as_bytes().to_vec()).collect();
|
config.alpn_protocols = alpn.iter().map(|s| s.as_bytes().to_vec()).collect();
|
||||||
|
|||||||
Reference in New Issue
Block a user