diff options
author | Joe Birr-Pixton <jpixton@gmail.com> | 2024-10-01 12:37:11 +0100 |
---|---|---|
committer | Joe Birr-Pixton <jpixton@gmail.com> | 2024-10-01 11:53:56 +0000 |
commit | df96abda886db90bf22c0a4966f85ff58123beab (patch) | |
tree | 51a1eec0c51c141386806be452e2a992e6a29f56 | |
parent | e52853a08fa366bb6f3253e932f5608c8b580d39 (diff) |
Fix tls13_packed_handshake test bitrot
These tests started failing, since the cert embedded in the
captured handshake expired. Verifying that cert is not
fundamental to the test, so don't.
-rw-r--r-- | rustls/tests/api.rs | 14 | ||||
-rw-r--r-- | rustls/tests/unbuffered.rs | 14 |
2 files changed, 16 insertions, 12 deletions
diff --git a/rustls/tests/api.rs b/rustls/tests/api.rs index 692ab4d4..c8632d04 100644 --- a/rustls/tests/api.rs +++ b/rustls/tests/api.rs @@ -7657,12 +7657,14 @@ fn tls13_packed_handshake() { // regression test for https://github.com/rustls/rustls/issues/2040 // (did not affect the buffered api) - let client_config = finish_client_config( - KeyType::Rsa2048, - ClientConfig::builder_with_provider(unsafe_plaintext_crypto_provider()) - .with_safe_default_protocol_versions() - .unwrap(), - ); + let client_config = ClientConfig::builder_with_provider(unsafe_plaintext_crypto_provider()) + .with_safe_default_protocol_versions() + .unwrap() + .dangerous() + .with_custom_certificate_verifier(Arc::new(MockServerVerifier::rejects_certificate( + CertificateError::UnknownIssuer.into(), + ))) + .with_no_client_auth(); let mut client = ClientConnection::new(Arc::new(client_config), server_name("localhost")).unwrap(); diff --git a/rustls/tests/unbuffered.rs b/rustls/tests/unbuffered.rs index 47b20820..97a0f189 100644 --- a/rustls/tests/unbuffered.rs +++ b/rustls/tests/unbuffered.rs @@ -792,12 +792,14 @@ fn tls13_packed_handshake() { } // regression test for https://github.com/rustls/rustls/issues/2040 - let client_config = finish_client_config( - KeyType::Rsa2048, - ClientConfig::builder_with_provider(unsafe_plaintext_crypto_provider()) - .with_safe_default_protocol_versions() - .unwrap(), - ); + let client_config = ClientConfig::builder_with_provider(unsafe_plaintext_crypto_provider()) + .with_safe_default_protocol_versions() + .unwrap() + .dangerous() + .with_custom_certificate_verifier(Arc::new(MockServerVerifier::rejects_certificate( + CertificateError::UnknownIssuer.into(), + ))) + .with_no_client_auth(); let mut client = UnbufferedClientConnection::new(Arc::new(client_config), server_name("localhost")).unwrap(); |