Fix receive reporting inconsistent state when a callback contaminates the error queue - #134
Merged
Merged
Conversation
… the error queue A callback running inside SSL_do_handshake can push an entry onto the thread's error queue, changing what SSL_get_error returns from SSL_ERROR_SSL to SSL_ERROR_SYSCALL without changing what actually failed. receive routed only SSL_ERROR_SSL through _peer_auth_failed(); SSL_ERROR_SYSCALL went straight to SSLError. Both now go through _peer_auth_failed(). Closes #119
SeanTAllen
force-pushed
the
fix-alpn-queue-contamination
branch
from
August 1, 2026 23:25
c9d9260 to
e50cc9e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SSL_get_errorreports what is on the thread's error queue, not what the call did. A callback running insideSSL_do_handshake— like the ALPN select callback — can push an entry that changesSSL_get_errorfromSSL_ERROR_SSLtoSSL_ERROR_SYSCALLwithout changing what actually failed.receiverouted onlySSL_ERROR_SSLthrough_peer_auth_failed();SSL_ERROR_SYSCALLmapped directly toSSLError. An ALPN resolver that happened to fail an OpenSSL call before returningALPNFatalwould leave a system error on the queue, shiftSSL_get_errortoSSL_ERROR_SYSCALL, and bypass the classification logic entirely. Both error codes now go through_peer_auth_failed(), so the reported state depends on what failed, not on what the callback happened to call.Closes #119