Update rustls to 0.21, webpki-roots to 0.23 (#2440)

This commit is contained in:
Sergio Benitez 2023-05-11 15:19:24 -07:00 committed by GitHub
parent 0dfebb202f
commit 8f4063c511
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -36,9 +36,9 @@ tokio = { workspace = true, optional = true }
# TLS
native-tls = { version = "0.2.10", optional = true }
rustls = { version = "0.20.6", default-features = false, features = ["dangerous_configuration", "tls12"], optional = true }
rustls = { version = "0.21", default-features = false, features = ["dangerous_configuration", "tls12"], optional = true }
rustls-pemfile = { version = "1.0", optional = true }
webpki-roots = { version = "0.22.0", optional = true }
webpki-roots = { version = "0.23", optional = true }
# Type Integrations
bit-vec = { workspace = true, optional = true }

View File

@ -6,7 +6,8 @@ use std::time::SystemTime;
use rustls::{
client::{ServerCertVerified, ServerCertVerifier, WebPkiVerifier},
ClientConfig, ClientConnection, Error as TlsError, OwnedTrustAnchor, RootCertStore, ServerName,
CertificateError, ClientConfig, ClientConnection, Error as TlsError, OwnedTrustAnchor,
RootCertStore, ServerName,
};
use crate::error::Error;
@ -234,8 +235,8 @@ impl ServerCertVerifier for NoHostnameTlsVerifier {
ocsp_response,
now,
) {
Err(TlsError::InvalidCertificateData(reason))
if reason.contains("CertNotValidForName") =>
Err(TlsError::InvalidCertificate(reason))
if reason == CertificateError::NotValidForName =>
{
Ok(ServerCertVerified::assertion())
}