Skip to content

Commit 9af30f4

Browse files
committed
client: NoneVerifier UnknownIssuer instead of BadSignature
The `NoneVerifier` that's used by default if a rustls client config builder is built without a verifier being specified was configured to return `Error::InvalidCertificate(CertificateError::BadSignature` from all of its trait methods. This commit updates the `verify_server_cert` trait method to instead return `Error::InvalidCertificate(CertificateError::UnknownIssuer)`. This will better match what would happen if you configured an empty root certificate store with a real verifier and is perhaps less confusing to debug than an error indicating a cryptographic signature validation error.
1 parent cbbef17 commit 9af30f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl ServerCertVerifier for NoneVerifier {
7676
_now: UnixTime,
7777
) -> Result<ServerCertVerified, rustls::Error> {
7878
Err(rustls::Error::InvalidCertificate(
79-
CertificateError::BadSignature,
79+
CertificateError::UnknownIssuer,
8080
))
8181
}
8282

0 commit comments

Comments
 (0)