From 6da92f1276f335f6caaea18ac15fc3373f34cc40 Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Sat, 2 Dec 2023 17:04:33 -0500 Subject: [PATCH 1/3] proj: git ignore .idea --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index fe42cc56..d4e1562d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ **/*.rs.bk Cargo.lock .DS_Store +/.idea From 89b075e8b4e1642b899c937efbd3906d64ed2069 Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Sat, 2 Dec 2023 17:08:33 -0500 Subject: [PATCH 2/3] Cargo: update to rustls 0.22 This commit updates to rustls 0.22, taking the following associated updates: * rustls 0.22.0-alpha-4 -> 0.22 * pki-types 0.2.2 -> 1 * webpki-roots 0.26.0-alpha.2 -> 0.26 * rustls-pemfile 2.0.0-alpha.2 -> 2 * webpki 0.102.0-alpha.8 -> 0.102 Breaking API changes are addressed as required. --- Cargo.toml | 10 +++++----- examples/client.rs | 1 - examples/server.rs | 1 - tests/badssl.rs | 7 +------ tests/early-data.rs | 11 ++++------- tests/test.rs | 3 --- tests/utils.rs | 2 -- 7 files changed, 10 insertions(+), 25 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6438010f..db59321b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,8 +14,8 @@ exclude = ["/.github", "/examples", "/scripts"] [dependencies] tokio = "1.0" -rustls = { version = "=0.22.0-alpha.6", default-features = false } -pki-types = { package = "rustls-pki-types", version = "0.2.2" } +rustls = { version = "0.22", default-features = false } +pki-types = { package = "rustls-pki-types", version = "1" } [features] default = ["logging", "tls12", "ring"] @@ -29,6 +29,6 @@ argh = "0.1.1" tokio = { version = "1.0", features = ["full"] } futures-util = "0.3.1" lazy_static = "1.1" -webpki-roots = "=0.26.0-alpha.2" -rustls-pemfile = "=2.0.0-alpha.2" -webpki = { package = "rustls-webpki", version = "=0.102.0-alpha.8", features = ["alloc", "std"] } +webpki-roots = "0.26" +rustls-pemfile = "2" +webpki = { package = "rustls-webpki", version = "0.102", features = ["alloc", "std"] } diff --git a/examples/client.rs b/examples/client.rs index 1a301abc..ed2ba963 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -52,7 +52,6 @@ async fn main() -> io::Result<()> { } let config = rustls::ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(root_cert_store) .with_no_client_auth(); // i guess this was previously the default? let connector = TlsConnector::from(Arc::new(config)); diff --git a/examples/server.rs b/examples/server.rs index b81b76c3..3c2b6e8d 100644 --- a/examples/server.rs +++ b/examples/server.rs @@ -56,7 +56,6 @@ async fn main() -> io::Result<()> { let flag_echo = options.echo_mode; let config = rustls::ServerConfig::builder() - .with_safe_defaults() .with_no_client_auth() .with_single_cert(certs, key) .map_err(|err| io::Error::new(io::ErrorKind::InvalidInput, err))?; diff --git a/tests/badssl.rs b/tests/badssl.rs index 1430d635..34da3293 100644 --- a/tests/badssl.rs +++ b/tests/badssl.rs @@ -35,11 +35,7 @@ async fn get( async fn test_tls12() -> io::Result<()> { let mut root_store = rustls::RootCertStore::empty(); root_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); - let config = rustls::ClientConfig::builder() - .with_safe_default_cipher_suites() - .with_safe_default_kx_groups() - .with_protocol_versions(&[&rustls::version::TLS12]) - .unwrap() + let config = rustls::ClientConfig::builder_with_protocol_versions(&[&rustls::version::TLS12]) .with_root_certificates(root_store) .with_no_client_auth(); @@ -68,7 +64,6 @@ async fn test_modern() -> io::Result<()> { let mut root_store = rustls::RootCertStore::empty(); root_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); let config = rustls::ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(root_store) .with_no_client_auth(); let config = Arc::new(config); diff --git a/tests/early-data.rs b/tests/early-data.rs index 20b258bb..f01189d5 100644 --- a/tests/early-data.rs +++ b/tests/early-data.rs @@ -133,13 +133,10 @@ async fn test_0rtt() -> io::Result<()> { root_store.add(cert.unwrap()).unwrap(); } - let mut config = rustls::ClientConfig::builder() - .with_safe_default_cipher_suites() - .with_safe_default_kx_groups() - .with_protocol_versions(&[&rustls::version::TLS13]) - .unwrap() - .with_root_certificates(root_store) - .with_no_client_auth(); + let mut config = + rustls::ClientConfig::builder_with_protocol_versions(&[&rustls::version::TLS13]) + .with_root_certificates(root_store) + .with_no_client_auth(); config.enable_early_data = true; let config = Arc::new(config); let addr = SocketAddr::from(([127, 0, 0, 1], server_port)); diff --git a/tests/test.rs b/tests/test.rs index b6423843..5598fd46 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -30,7 +30,6 @@ lazy_static! { .unwrap(); let config = rustls::ServerConfig::builder() - .with_safe_defaults() .with_no_client_auth() .with_single_cert(cert, key.into()) .unwrap(); @@ -117,7 +116,6 @@ async fn pass() -> io::Result<()> { } let config = rustls::ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(root_store) .with_no_client_auth(); let config = Arc::new(config); @@ -137,7 +135,6 @@ async fn fail() -> io::Result<()> { } let config = rustls::ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(root_store) .with_no_client_auth(); let config = Arc::new(config); diff --git a/tests/utils.rs b/tests/utils.rs index 3d70ad61..8282a03a 100644 --- a/tests/utils.rs +++ b/tests/utils.rs @@ -19,7 +19,6 @@ mod utils { .unwrap() .unwrap(); let sconfig = ServerConfig::builder() - .with_safe_defaults() .with_no_client_auth() .with_single_cert(cert, key.into()) .unwrap(); @@ -31,7 +30,6 @@ mod utils { } let cconfig = ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(client_root_cert_store) .with_no_client_auth(); From 3be1d2edb6d2a141ec7e0c137233e4d65e1091dc Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Sat, 2 Dec 2023 17:11:58 -0500 Subject: [PATCH 3/3] Cargo: version 0.25.0-alpha.4 -> 0.25.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index db59321b..d9093676 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tokio-rustls" -version = "0.25.0-alpha.4" +version = "0.25.0" license = "MIT/Apache-2.0" repository = "https://github.com/rustls/tokio-rustls" homepage = "https://github.com/rustls/tokio-rustls"