Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depend directly on rustls #1020

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions async-nats/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tokio = { version = "1.25.0", features = ["macros", "rt", "fs", "net", "sync", "
itoa = "1"
url = { version = "2"}
tokio-rustls = "0.24"
rustls = "0.21.5"
rustls-pemfile = "1.0.2"
nuid = "0.3.2"
serde_nanos = "0.1.3"
Expand Down
4 changes: 2 additions & 2 deletions async-nats/src/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

use crate::connector::ConnectorOptions;
use crate::tls;
use rustls::{self, Certificate, OwnedTrustAnchor, PrivateKey};
use std::fs::File;
use std::io::{self, BufReader, ErrorKind};
use std::path::PathBuf;
use tokio_rustls::rustls::{self, Certificate, OwnedTrustAnchor, PrivateKey};
use webpki::TrustAnchor;

/// Loads client certificates from a `.pem` file.
Expand Down Expand Up @@ -63,7 +63,7 @@ pub(crate) async fn load_key(path: PathBuf) -> io::Result<PrivateKey> {
}

pub(crate) async fn config_tls(options: &ConnectorOptions) -> io::Result<rustls::ClientConfig> {
let mut root_store = tokio_rustls::rustls::RootCertStore::empty();
let mut root_store = rustls::RootCertStore::empty();
// load native system certs only if user did not specify them.
if options.tls_client_config.is_some() || options.certificates.is_empty() {
root_store.add_parsable_certificates(
Expand Down