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

update rustls to latest version #2107

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
88 changes: 68 additions & 20 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ async-std = "1.6"
tokio = "1.21"
tokio-native-tls = "0.3.0"
tokio-openssl = "0.6.0"
tokio-rustls = "0.24.0"
tokio-rustls = "0.25.0"
tokio-util = "0.7.9"
parking_lot = "0.12"


# ssl
native-tls = "0.2"
openssl = "0.10.55"
rustls = "0.21.8"
rustls-native-certs = "0.6.3"
rustls-pemfile = "1.0.0"
webpki-roots = "0.25.0"
rustls = "0.22.0"
rustls-native-certs = "0.7"
rustls-pemfile = "2"
webpki-roots = "0.26"
ring = "0.17"


Expand Down
2 changes: 1 addition & 1 deletion crates/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dns-over-https-rustls = [
"rustls",
"hickory-proto/dns-over-https-rustls",
]
dns-over-https = ["hickory-proto/dns-over-https"]
dns-over-https = ["rustls", "hickory-proto/dns-over-https"]

dns-over-quic = ["dns-over-rustls", "hickory-proto/dns-over-quic"]

Expand Down
2 changes: 1 addition & 1 deletion crates/proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dns-over-https-rustls = ["dns-over-https"]
dns-over-https = ["bytes", "h2", "http", "dns-over-rustls", "tokio-runtime"]
dns-over-quic = [
"quinn",
"rustls/quic",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"rustls",
"dns-over-rustls",
"bytes",
"tokio-runtime",
Expand Down
8 changes: 2 additions & 6 deletions crates/proto/src/h2/h2_client_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ where
.expect("programming error, tls should not be None here");
let name_server_name = Arc::clone(&tls.dns_name);

match tls.dns_name.as_ref().try_into() {
match tls.dns_name.as_ref().to_owned().try_into() {
Ok(dns_name) => {
let tls = TlsConnector::from(tls.client_config);
let tls = tls.connect(dns_name, AsyncIoStdAsTokio(tcp));
Expand Down Expand Up @@ -746,7 +746,7 @@ mod tests {
#[cfg(all(feature = "native-certs", not(feature = "webpki-roots")))]
{
let (added, ignored) = root_store
.add_parsable_certificates(&rustls_native_certs::load_native_certs().unwrap());
.add_parsable_certificates(rustls_native_certs::load_native_certs().unwrap());

if ignored > 0 {
warn!(
Expand All @@ -769,10 +769,6 @@ mod tests {
}));

let mut client_config = ClientConfig::builder()
.with_safe_default_cipher_suites()
.with_safe_default_kx_groups()
.with_safe_default_protocol_versions()
.unwrap()
.with_root_certificates(root_store)
.with_no_client_auth();

Expand Down
4 changes: 2 additions & 2 deletions crates/proto/src/rustls/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ fn tls_client_stream_test(server_addr: IpAddr, mtls: bool) {
// let timeout = Timeout::new(Duration::from_secs(5));

let mut roots = rustls::RootCertStore::empty();
let (_, ignored) = roots.add_parsable_certificates(&[root_cert_der]);
let (_, ignored) =
roots.add_parsable_certificates([root_cert_der].into_iter().map(|x| x.into()));
assert_eq!(ignored, 0, "bad certificate!");
let mut config = ClientConfig::builder()
.with_safe_defaults()
.with_root_certificates(roots)
.with_no_client_auth();

Expand Down