• 
      

    Add conversion between OpenSSL verification codes and our failure codes.

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

    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.
    faed8d462dccdeb61f49616db8b6b6244a6a9173
    Description From Last Updated

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

    david david

    Shouldn't this be HOSTNAME_MISMATCH?

    david david
    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. 
        
    chipx86
    maubin
    1. Ship It!
    2. 
        
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-7.1.x (2f5f7db)