Skip to content

Commit 11801b7

Browse files
cpudjc
authored andcommitted
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.
1 parent a6c6f72 commit 11801b7

File tree

7 files changed

+10
-25
lines changed

7 files changed

+10
-25
lines changed

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ exclude = ["/.github", "/examples", "/scripts"]
1414

1515
[dependencies]
1616
tokio = "1.0"
17-
rustls = { version = "=0.22.0-alpha.6", default-features = false }
18-
pki-types = { package = "rustls-pki-types", version = "0.2.2" }
17+
rustls = { version = "0.22", default-features = false }
18+
pki-types = { package = "rustls-pki-types", version = "1" }
1919

2020
[features]
2121
default = ["logging", "tls12", "ring"]
@@ -29,6 +29,6 @@ argh = "0.1.1"
2929
tokio = { version = "1.0", features = ["full"] }
3030
futures-util = "0.3.1"
3131
lazy_static = "1.1"
32-
webpki-roots = "=0.26.0-alpha.2"
33-
rustls-pemfile = "=2.0.0-alpha.2"
34-
webpki = { package = "rustls-webpki", version = "=0.102.0-alpha.8", features = ["alloc", "std"] }
32+
webpki-roots = "0.26"
33+
rustls-pemfile = "2"
34+
webpki = { package = "rustls-webpki", version = "0.102", features = ["alloc", "std"] }

examples/client.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ async fn main() -> io::Result<()> {
5252
}
5353

5454
let config = rustls::ClientConfig::builder()
55-
.with_safe_defaults()
5655
.with_root_certificates(root_cert_store)
5756
.with_no_client_auth(); // i guess this was previously the default?
5857
let connector = TlsConnector::from(Arc::new(config));

examples/server.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ async fn main() -> io::Result<()> {
5656
let flag_echo = options.echo_mode;
5757

5858
let config = rustls::ServerConfig::builder()
59-
.with_safe_defaults()
6059
.with_no_client_auth()
6160
.with_single_cert(certs, key)
6261
.map_err(|err| io::Error::new(io::ErrorKind::InvalidInput, err))?;

tests/badssl.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ async fn get(
3535
async fn test_tls12() -> io::Result<()> {
3636
let mut root_store = rustls::RootCertStore::empty();
3737
root_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
38-
let config = rustls::ClientConfig::builder()
39-
.with_safe_default_cipher_suites()
40-
.with_safe_default_kx_groups()
41-
.with_protocol_versions(&[&rustls::version::TLS12])
42-
.unwrap()
38+
let config = rustls::ClientConfig::builder_with_protocol_versions(&[&rustls::version::TLS12])
4339
.with_root_certificates(root_store)
4440
.with_no_client_auth();
4541

@@ -68,7 +64,6 @@ async fn test_modern() -> io::Result<()> {
6864
let mut root_store = rustls::RootCertStore::empty();
6965
root_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
7066
let config = rustls::ClientConfig::builder()
71-
.with_safe_defaults()
7267
.with_root_certificates(root_store)
7368
.with_no_client_auth();
7469
let config = Arc::new(config);

tests/early-data.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,10 @@ async fn test_0rtt() -> io::Result<()> {
133133
root_store.add(cert.unwrap()).unwrap();
134134
}
135135

136-
let mut config = rustls::ClientConfig::builder()
137-
.with_safe_default_cipher_suites()
138-
.with_safe_default_kx_groups()
139-
.with_protocol_versions(&[&rustls::version::TLS13])
140-
.unwrap()
141-
.with_root_certificates(root_store)
142-
.with_no_client_auth();
136+
let mut config =
137+
rustls::ClientConfig::builder_with_protocol_versions(&[&rustls::version::TLS13])
138+
.with_root_certificates(root_store)
139+
.with_no_client_auth();
143140
config.enable_early_data = true;
144141
let config = Arc::new(config);
145142
let addr = SocketAddr::from(([127, 0, 0, 1], server_port));

tests/test.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ lazy_static! {
3030
.unwrap();
3131

3232
let config = rustls::ServerConfig::builder()
33-
.with_safe_defaults()
3433
.with_no_client_auth()
3534
.with_single_cert(cert, key.into())
3635
.unwrap();
@@ -117,7 +116,6 @@ async fn pass() -> io::Result<()> {
117116
}
118117

119118
let config = rustls::ClientConfig::builder()
120-
.with_safe_defaults()
121119
.with_root_certificates(root_store)
122120
.with_no_client_auth();
123121
let config = Arc::new(config);
@@ -137,7 +135,6 @@ async fn fail() -> io::Result<()> {
137135
}
138136

139137
let config = rustls::ClientConfig::builder()
140-
.with_safe_defaults()
141138
.with_root_certificates(root_store)
142139
.with_no_client_auth();
143140
let config = Arc::new(config);

tests/utils.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ mod utils {
1919
.unwrap()
2020
.unwrap();
2121
let sconfig = ServerConfig::builder()
22-
.with_safe_defaults()
2322
.with_no_client_auth()
2423
.with_single_cert(cert, key.into())
2524
.unwrap();
@@ -31,7 +30,6 @@ mod utils {
3130
}
3231

3332
let cconfig = ClientConfig::builder()
34-
.with_safe_defaults()
3533
.with_root_certificates(client_root_cert_store)
3634
.with_no_client_auth();
3735

0 commit comments

Comments
 (0)