Add conversion between OpenSSL verification codes and our failure codes.
Review Request #14942 — Created March 18, 2026 and submitted
This introduces a table mapping OpenSSL's numeric verification codes to
ourCertificateVerificationFailureCodeenum. This helps to create the
right exceptions for anSSLError.Python doesn't expose constants for any of these codes, so the numeric
values are used along with comments listing the OpenSSL error code's
typical constant.
CertificateVerificationFailureCode.for_ssl_verify_code()is used to
produce the right code based on the mapping. This will be used in
upcoming handling ofSSLErrors.
Unit tests pass.
Review request changed
- Change Summary:
-
- Split the
CertificateVerificationFailureCodetests into a new file. - Fixed a leftover bad mismatch in those tests from my testing.
- Bumped version to RB8.
- Split the
- Commits:
-
Summary ID 900d978ec35a8398c2a11d58f94e923b6606e5ee faed8d462dccdeb61f49616db8b6b6244a6a9173
Checks run (2 succeeded)
flake8
passed.
JSHint
passed.