Skip to content

Commit

Permalink
refactor: use rustls reexported from tokio_rustls
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Nov 9, 2024
1 parent 3b2f18f commit b112a13
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/net/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ pub async fn wrap_rustls(
alpn: &[&str],
stream: impl SessionStream,
) -> Result<impl SessionStream> {
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();
Expand Down

0 comments on commit b112a13

Please sign in to comment.