Fix NoHostnameTlsVerifier for rustls 0.23.24 and above (#3861)

This commit is contained in:
Elichai Turkel
2025-07-02 13:48:51 +03:00
committed by GitHub
parent ba23fdeb76
commit 2970559e25
3 changed files with 13 additions and 10 deletions

View File

@@ -48,7 +48,7 @@ tokio = { workspace = true, optional = true }
# TLS
native-tls = { version = "0.2.10", optional = true }
rustls = { version = "0.23.15", default-features = false, features = ["std", "tls12"], optional = true }
rustls = { version = "0.23.24", default-features = false, features = ["std", "tls12"], optional = true }
webpki-roots = { version = "0.26", optional = true }
rustls-native-certs = { version = "0.8.0", optional = true }

View File

@@ -309,9 +309,9 @@ impl ServerCertVerifier for NoHostnameTlsVerifier {
ocsp_response,
now,
) {
Err(TlsError::InvalidCertificate(CertificateError::NotValidForName)) => {
Ok(ServerCertVerified::assertion())
}
Err(TlsError::InvalidCertificate(
CertificateError::NotValidForName | CertificateError::NotValidForNameContext { .. },
)) => Ok(ServerCertVerified::assertion()),
res => res,
}
}