• 
      

    Add conversion between OpenSSL verification codes and our failure codes.

    Review Request #14942 — Created March 18, 2026 and updated

    Information

    Review Board
    release-7.1.x

    Reviewers

    This introduces a table mapping OpenSSL's numeric verification codes to
    our CertificateVerificationFailureCode enum. This helps to create the
    right exceptions for an SSLError.

    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 of SSLErrors.

    Unit tests pass.

    Summary ID
    Add conversion between OpenSSL verification codes and our failure codes.
    This introduces a table mapping OpenSSL's numeric verification codes to our `CertificateVerificationFailureCode` enum. This helps to create the right exceptions for an `SSLError`. 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 of `SSLError`s.
    900d978ec35a8398c2a11d58f94e923b6606e5ee
    Description From Last Updated

    This should be CertificateVerificationFailureCode.for_ssl_verify_code (Error -> FailureCode)

    daviddavid

    Shouldn't this be HOSTNAME_MISMATCH?

    daviddavid
    Checks run (2 succeeded)
    flake8 passed.
    JSHint passed.
    david
    1. 
        
    2. Show all issues

      This should be CertificateVerificationFailureCode.for_ssl_verify_code (Error -> FailureCode)

    3. Show all issues

      Shouldn't this be HOSTNAME_MISMATCH?

    4.