-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Enable SslStream server options per-hostname (in callback) #31097
Comments
@Tratcher This issue should be moved to aspnetcore repo. |
@davidsh Seems like this would require an SSLStream change? |
@davidsh they're asking to be able to reconfigure the SslServerAuthenticationOptions from inside the ServerCertificateSelectionCallback based on the given SNI host name. I've heard a similar request asking to be able to enable/disable TLS versions based on the SNI data. |
Thanks for clarifying. Would this be an API change to SslServerAuthenticationOptions or perhaps just a behavior change of some kind, triggered by an perhaps a new opt-in SslStream-related property? This needs some design work. |
We'd have to experiment. ServerCertificateSelectionCallback passes in the SslStream as an |
Triage: Sounds like reasonable request. It may need new API. |
should be fixed by #38760. |
Hello,
Our service is a reverse proxy running on IIS (on top of HttpSys). We are moving to .NET core and while running on Kestrel, ran into a scenario blocker with client certificates.
In our current application, we use HttpSys APIs to configure client certificate negotiation per hostname and also to set up CTL stores.
The specific API we use is : https://docs.microsoft.com/en-us/windows/win32/http/add-sslcert
Examples of usage:
netsh http add sslcert hostnameport=a.b.microsoftonline.com:443
certhash=EC9CA6E0E645AAB24F8AD890DF75A448824D2C37 appid='{4dc3e181-e14b-4a21-b022-59fc669b0914}' certstorename=MY
verifyclientcertrevocation=disable
netsh http add sslcert hostnameport=c.windows.net:443
certhash=EB3C3B94F10E948463929BCF4C7000C1E7BD0AC1 appid='{4dc3e181-e14b-4a21-b022-59fc669b0914}' certstorename=MY
clientcertnegotiation=enable verifyclientcertrevocation=disable
netsh http add sslcert hostnameport=device.a.b.microsoftonline.com:443
certhash=963B55D3E94101B70F1654FBF90D6006BAFAD513 appid='{4dc3e181-e14b-4a21-b022-59fc669b0914}' certstorename=MY
clientcertnegotiation=enable verifyclientcertrevocation=disable sslctlstorename=DeviceLoginCTLStore
We want the ability to perform these operations in the Kestrel webserver. (The workaround of using the HttpSysServer does not work for us, I will not go into the reasons in this issue, I will create a separate one for that).
Kestrel already provides SNI support (ability to select server certificate on a per hostname basis). However, the problem is that the client certificate negotiation (and CTL store) support is application wide and not per hostname.
https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.server.kestrel.https.clientcertificatemode?view=aspnetcore-2.2#Microsoft_AspNetCore_Server_Kestrel_Https_ClientCertificateMode_NoCertificate.
To be specific:
(an equivalent to the "verifyclientcertrevocation" property in HttpSys.)
This is a major blocker for us to migrate to .NET core.
The text was updated successfully, but these errors were encountered: