Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-123954: proposal for improving logic for setting SSL exceptions#128391
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
base:main
Are you sure you want to change the base?
Conversation
picnixz commented Jan 1, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
picnixz commented Jan 1, 2025
Since all strings that will be rendered in the exception are actually ASCII messages (no localization), I'm considering switching from a PyDict storage to a I haven't checked more in details though since I already want to know whether the proposal performs well. |
ZeroIntensity commented Jan 1, 2025
|
picnixz commented Jan 1, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
No, we're only reading from the hash table. It is cached in the module's state and we only lookup strings by integer keys or pairs of integers. |
ZeroIntensity commented Jan 4, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Looks like an upstream issue. (I'll file an issue and CC you.) There's two pieces of relevant code on OpenSSL's end. Here: |
e9d3230 to 522da2bCompare522da2b to 6b38769CompareZeroIntensity commented Jan 9, 2025
OpenSSL has fixed the issue upstream, but it looks like the release isn't due until April. |
picnixz commented Jan 10, 2025
Oups I misclicked on my mobile app. It's still a draft. |
ZeroIntensity commented Jan 10, 2025
Converted it back for you. IIRC the GitHub app doesn't let you mark something as a draft. |
picnixz commented Jan 11, 2025
Btw, I think we also have another issue with another code:
I didn't check whether this is still the case, but it's probably worth to check as well. |
ZeroIntensity commented Jan 11, 2025
Frustratingly, looks like OpenSSL again: https://github.com/openssl/openssl/blob/b049ce0e354011be075e620b9ba7cf4d7c8f9577/crypto/err/openssl.txt#L414 and https://github.com/openssl/openssl/blob/b049ce0e354011be075e620b9ba7cf4d7c8f9577/include/openssl/comperr.h#L28 I guess I'll go pester them again. Are there any other cases like this, or is this the last one? |
picnixz commented Jan 11, 2025
I think it's the last one. At least, I don't see more warnings in the CI. |
ZeroIntensity commented Jan 11, 2025
I found a few others while reporting the issue, FWIW. |
picnixz commented Jan 11, 2025
Thanks! I think we don't use those, hence I didn't have the warning (or maybe we're using it and something else is wrong in my warnings being emitted?) |
I'd recommend also reviewing each commit separately due to the changes arising from logic extraction. I've also observed that we incorrectly use
ERR_GET_REASON(p)on a custom error code. It's not really an issue because this is a no-op but I've added an assertion and removed the call for the semantics to match (we format the message using the error coming fromERR_peek_last_error()but the exception object is initialized with another error code that can also be obtained bySSL_get_error()or is a custom one).I haven't benchmarked the branch, I just want to share a proposal. Note that refactoring the logic could help target the operations that take longer time.
cc @tarasko@kumaraditya303@gpshead