Skip to content

Commit

Permalink
Cargo: update to rustls 0.22
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cpu authored and djc committed Dec 5, 2023
1 parent a6c6f72 commit 11801b7
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 25 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"] }
1 change: 0 additions & 1 deletion examples/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
1 change: 0 additions & 1 deletion examples/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))?;
Expand Down
7 changes: 1 addition & 6 deletions tests/badssl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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);
Expand Down
11 changes: 4 additions & 7 deletions tests/early-data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
3 changes: 0 additions & 3 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions tests/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -31,7 +30,6 @@ mod utils {
}

let cconfig = ClientConfig::builder()
.with_safe_defaults()
.with_root_certificates(client_root_cert_store)
.with_no_client_auth();

Expand Down

0 comments on commit 11801b7

Please sign in to comment.