-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Remove OpenSSL error queue checking in SslInitializer #65435
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
Remove OpenSSL error queue checking in SslInitializer #65435
Conversation
Tagging subscribers to this area: @dotnet/ncl, @vcsjones Issue DetailsFixes Issue #64492 There is a possibility that a previous crypto operation left an error in the OpenSSL error queue, which would prevent
|
test failure unrelated. probably outcome of #64747. Root cause may be similar to #43686.
|
if (Interop.Crypto.ErrPeekLastError() != 0) | ||
{ | ||
// It is going to be wrapped in a type load exception but will have the error information | ||
throw Interop.Crypto.CreateOpenSslCryptographicException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we clean up the queue and put the error to trace log for troubleshooting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since none of the initialization code can produce errors, it's just a sign that the initializer ran on a thread where some OpenSSL-related activity had already happened (and happened to leave an error behind). I don't think it's interesting to log. (For the same reason I suggested just deleting this code)
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1858570523 |
Fixes #64492
as noted by @bartonjs in #64492 (comment), nothing in the
CryptoNative_EnsureLibSslInitialized
puts any errors in the error queue, so it is not necessary to check it after finishing.In 6.0, there is a possibility that if a previous crypto operation left an error in the OpenSSL error queue then
SslInitializer
would be prevented from completing correctly (See discussion of the original issue for more details.), this has probably been greatly reduced or even fixed by #65148 for 7.0, but backporting change made in this PR to 6.0 should be less risky and just as effective.