Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssl.SSLError.reason #4000

Closed
youknowone opened this issue Aug 5, 2022 · 3 comments
Closed

ssl.SSLError.reason #4000

youknowone opened this issue Aug 5, 2022 · 3 comments
Assignees
Labels
A-stdlib C-compat A discrepancy between RustPython and CPython

Comments

@youknowone
Copy link
Member

Feature

ssl.SSLError.reason

Python Documentation

https://docs.python.org/3/library/ssl.html#ssl.SSLError.reason

@youknowone youknowone added C-compat A discrepancy between RustPython and CPython A-stdlib good first issue Good for newcomers and removed good first issue Good for newcomers labels Aug 5, 2022
@tgsong827
Copy link
Contributor

can you assign this to me?

@tgsong827
Copy link
Contributor

tgsong827 commented Aug 13, 2022

Is this issue related with the sslError format made by fn convert_openssl_error() ?

I found that RustPython's sslError format is different with CPython's.

  • RustPython
ssl.SSLError: [Errno 136] [x509 certificate routines] no certificate or crl found (ssl.rs:691)
  • CPython
ssl.SSLError: [X509: NO_CERTIFICATE_OR_CRL_FOUND] no certificate or crl found (_ssl.c:4293)

CPython is printing lib name : X509 and reason name : NO_CERTIFICATE_OR_CRL_FOUND.
RustPython is printing errCode : [Errno 136] and lib str : [x509 certificate routines].
and errStr : no certificate or crl found is same

CPython is using _ssl_data.h to get the lib name and reason name.

so I wonder this issue is about it ??

@youknowone
Copy link
Member Author

The issue is not about messages but absense of the attribute reason.
In CPython, fill_and_set_sslerror function adds reason attribute, while RustPython doesn't do in convert_openssl_error.

Maybe having same messages would be better, but we don't count them as incompatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stdlib C-compat A discrepancy between RustPython and CPython
Projects
None yet
Development

No branches or pull requests

2 participants