Repository navigation
Fix socket-bound TLS post-handshake authentication progress - #136475
Merged
Merged
Conversation
Keep the first fd-mode handshake call limited to sending the client-certificate request so a fast peer cannot complete authentication before the driver starts checking for its response. Cover both ready and idle peers for TLS 1.2 and TLS 1.3. Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones |
wfurt
approved these changes
Oct 27, 2026
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.
Fix a post-handshake authentication race that can leave a socket-bound TLS session waiting indefinitely even though the peer has finished the exchange.
The first native handshake call currently invokes
SSL_peek, which can process a fast peer's entire response. The driver then returnsNeedMoreDatabecause it considers that call request-flushing only. Subsequent calls wait for socket readability, but the response has already been consumed.Separate request emission from response processing: skip the peek while flushing the initial certificate request, then retain it on subsequent calls. This preserves write-backpressure retries, handshake completion checks, and certificate-validation suspension. Extend the existing TLS 1.2/1.3 theory with idle-peer cases to verify that sending the request alone does not prematurely complete authentication. No timeout increases or test skips.
Validation
clr+libsbaseline and native/managed incremental builds passed with zero warnings or errors. The WSL baseline used explicit Git revision metadata for the Windows-created worktree.System.Net.Securityfunctional suite: 5,127 passed, 0 failed, 8 existing conditional skips.DOTNET_JitStress=2with tiering enabled, and withDOTNET_JitStressRegs=4and tiering disabled): 40 passed, 0 skipped.Validation used Ubuntu WSL and OpenSSL 3.5.3, not the exact AzureLinux CI image. Older OpenSSL versions and forced write-backpressure were not exercised.
Resolves #134222
Note
This pull request was authored with assistance from GitHub Copilot.