-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Expose SNI hostname in ITlsHandshakeFeature for Kestrel/HttpSys #48572
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
Thanks for your PR, @karimsalem1. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
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.
Are you planning to do IIS as well?
src/Servers/Connections.Abstractions/src/Features/ITlsHandshakeFeature.cs
Outdated
Show resolved
Hide resolved
Will do in another PR. |
src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
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.
Trying to use null vs String.Empty to distinguish between different conditions is discouraged, it's not self-descriptive. Is there a requirement to know if the client didn't support SNI as compared to sending an empty value? I don't think there's a practical difference from the server side, it requires an SNI value or it doesn't.
Given this, should we update the api to be string HostName => "";
? Is there any value to knowing whether it's been explicitly implemented or not? I'm okay with it as-is, but making it non-nullable could reduce unnecessary null checks.
Good call, return string.Empty from the default implementation. |
I've updated the API review issue. Hopefully we can quickly approve it again Thursday. |
@karimsalem1, this change will be considered for inclusion in the blog post for the release it'll ship in. Nice work! Please ensure that the original comment in this thread contains a clear explanation of what the change does, why it's important (what problem does it solve?), and, if relevant, include things like code samples and/or performance numbers. This content may not be exactly what goes into the blog post, but it will help the team putting together the announcement. Thanks! |
Expose SNI hostname in ITlsHandshakeFeature for Kestrel/HttpSys
Summary of the changes (Less than 80 chars)
Exposing SNI HostName in the ITlsHandshakeFeature interface.
Description
Exposing SNI HostName in the ITlsHandshakeFeature interface to allow users to retrieve the server_name used in the ClientHello of the TLS handshake. This PR applies to both Kestrel and HttpSys servers.
Issue opened and API approved here: #34525