improve accuracy of SslClientHelloInfo#128244
Merged
Merged
Conversation
Contributor
|
Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves SslStream server-side ClientHello handling so ServerOptionsSelectionCallback receives TLS versions advertised via the supported_versions extension, especially for TLS 1.3.
Changes:
- Enables ClientHello supported-version parsing when a server options callback is configured.
- Adds a TLS 1.3 regression test verifying the callback sees
Tls13.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs |
Adds supported-version parsing for the server options callback path. |
src/libraries/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs |
Adds regression coverage for TLS 1.3 version visibility in the SNI/options callback. |
liveans
reviewed
May 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/libraries/System.Net.Security/src/System/Net/Security/TlsFrameHelper.cs:531
- Now that
Versionsis enabled for the SNI callback path, this parser should reject malformedsupported_versionsvectors before exposing them to user code.TryGetSupportedVersionsFromExtensioncurrently returns true for a zero-length vector and for odd byte counts (it just drops the trailing byte), even though the TLS vector must contain one or more 2-byte ProtocolVersion values. That can makeSslClientHelloInfo.SslProtocolslook valid but incomplete for malformed ClientHello messages.
else if (extensionType == ExtensionType.SupportedVersions && (options & ProcessingOptions.Versions) != 0)
{
if (!TryGetSupportedVersionsFromExtension(extensionData, out SslProtocols versions))
{
return false;
Member
|
cc @MihaZupan |
liveans
approved these changes
May 15, 2026
MihaZupan
approved these changes
May 15, 2026
This was referenced May 15, 2026
Open
Member
|
/ba-g test failure is unrelated |
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.
We construct SslClientHelloInfo when using ServerOptionsSelectionCallback delegate. That was primarily meant to SNI but is also have bit mask of client supported versions. The change makes sure we process all of them from the client hello.