-
Notifications
You must be signed in to change notification settings - Fork 5.2k
add TargetHostName to SslStream #38202
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
Conversation
|
Tagging subscribers to this area: @dotnet/ncl |
|
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
What kind of name do we fabricate? Can you provide an example? |
src/libraries/System.Net.Security/src/System/Net/Security/SslAuthenticationOptions.cs
Show resolved
Hide resolved
Something like runtime/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs Lines 70 to 73 in 3495f1a
|
That does look really strange. This was inherited from .NET Framework: |
|
When no name is provided then it is harder for ssl client to verify serve's name. |
stephentoub
left a comment
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.
We can follow-up on the strange constructed names subsequently. Is there an issue for that?
src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs
Show resolved
Hide resolved
|
This exposes internal property used with SNI. This will return string.Empty if not available to be consistent with ServerCertificateSelectionCallback.
Strangely, when empty name is provided, we fabricate random name instead of skipping SNI extension. This is probably not common case so I made the property to return the fabricated name instead of empty value from SslClientAuthenticationOptions. On server, this gets name requested by client. Since the behavior above, it is not easy to construct test without SNI.
related to #37933
fixes #27619