-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
OpenSSL should clear error queue before each call #8456
Comments
I would say that this helps it "be better for multi threaded" as well, but, on closer examination, for SSL_Accept it calls underlying |
I think what should happen is that when there is a fiber context switch, it should "save away" any current openssl failures (and restore from the incoming fiber). Also OpenSSL_Shutdown should clear the queue. FWIW...the latter being the easier of the two, I'll hopefully do a PR for it sometime :) |
@rdp at the moment, fibers can only change threads at specific points. As long as none of these occur between setting an error and reading it, it should be fine. |
Yeah typically that's enough. Unfortunately sometimes OpenSSL makes several calls to underlying socket ref: https://stackoverflow.com/q/18179128/32453 comment Now that you mention it, if we were to make these "thread local" messages basically "fiber local" then...we could call ERR_clear_error before every call to guarantee a clear stack. The original request :) |
Appears the "best practice" for OpenSSL is to call ERR_clear_error before doing any call, basically "just in case" an earlier SSL_xx call didn't handle its error return value(s) right.
https://stackoverflow.com/questions/18179128/how-to-manage-the-error-queue-in-openssl-ssl-get-error-and-err-get-error
related discussion:
#8103 (comment)
The text was updated successfully, but these errors were encountered: