Skip to content
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

Add server-side SslStream support for SNI and multiple server certificates #17677

Closed
Tratcher opened this issue Jun 22, 2016 · 17 comments
Closed
Labels
api-needs-work API needs work before it is approved, it is NOT ready for implementation area-System.Net
Milestone

Comments

@Tratcher
Copy link
Member

https://tools.ietf.org/html/rfc6066#section-3

This is needed for servers servicing multiple host names.
https://github.com/aspnet/KestrelHttpServer/issues/241

@davidsh
Copy link
Contributor

davidsh commented Jun 22, 2016

cc: @CIPop @himadrisarkar @stephentoub

@davidsh
Copy link
Contributor

davidsh commented Jun 22, 2016

Basically the same as #15813 #15077

@0xfffffff7
Copy link

0xfffffff7 commented Jun 27, 2016

SslStream is not supported SNI?

@CIPop
Copy link
Member

CIPop commented Aug 4, 2016

I'm not sure this is the same as the ALPN feature. SNI is a different extension of the TLS handshake introduced much earlier than ALPN. My understanding is that:

  • SNI would allow a client to specify the host name (certificate name) and a server to host multiple sites on the same IP address.
  • ALPN allows a client to specify a protocol and a server to host multiple applications on the same TCP/UDP address (port).

@CIPop CIPop self-assigned this Aug 4, 2016
@CIPop CIPop changed the title Add SslStream support for SNI and multiple server certificates Add server-side SslStream support for SNI and multiple server certificates Aug 4, 2016
@karelz
Copy link
Member

karelz commented Mar 2, 2017

Next step: We need formal API proposal.

@lodejard
Copy link

lodejard commented Aug 8, 2017

Yes, please! /cc @davidfowl @Eilon @DamianEdwards

Without SNI you must have a different public ip (and load balancer configuration) per common-name. This is totally different from ALPN, which is more about enabling http/2.

This is a feature Java/Node have had SNI for years and years. It's also worth verifying that the various .net https clients are sending SNI information on connect.

https://netty.io/4.0/api/io/netty/handler/ssl/SniHandler.html
https://nodejs.org/api/tls.html#tls_alpn_npn_and_sni

@Eilon
Copy link
Member

Eilon commented Aug 8, 2017

Hmm yes I guess that if Kestrel is used as an "edge" server, which when ASP.NET Core 2.0.0 is released, will officially be a thing, then this becomes that much more important, correct?

@Tratcher
Copy link
Member Author

Tratcher commented Aug 8, 2017

Indeed. The one limiter is that Kestrel still can't share ports with other instances/processes so you'd have to be running multiple domains on the same instance of Kestrel to take advantage of SNI.

@buvinghausen
Copy link

Don't want to plus one this issue but we're here because of Mongo Atlas needing SNI support

Atlas Driver Info

For now we're just going to leave our non production items on mlab but it would be nice to go to a single management console for our stack.

@karelz
Copy link
Member

karelz commented Feb 6, 2018

@buvinghausen AFAIK Mongo driver was blocked on client-side SNI, which was implemented in 2.1. If you really need server-side SNI, please provide deeper info about your requirements, scenario, etc.

@buvinghausen
Copy link

@karelz I will check that out later but thanks for the heads up! I will come back and let you know... by proxy if that fixes it I will let them know as well.

@buvinghausen
Copy link

@karelz I can officially confirm we moved to .NET Core 2.1 on Sunday and today we're able to connect to the free Mongo clusters from our Linux containers. Thank you for the clarification and anyone who lands on this page because of the Mongo documentation just know you need to run .NET Core 2.1

@stephentoub
Copy link
Member

@buvinghausen
Copy link

@karelz just a heads up but we experience problems with the MongoDB 3.6 connection string to Atlas on both OSX and the Linux Alpine Docker image. It works great on Windows and it works great on the Debian Stretch Docker image. I'm not sure if this is the place to list this but I've chosen here just in case anyone else follows the link from the MongoDB .NET Core page which lands here. Is there a better place for me to report this?

@Tratcher
Copy link
Member Author

@buvinghausen I think you're looking for SQL Server Network Interface, not TLS Server Name Indication? Regardless please open new issues rather than commending on closed ones.

@buvinghausen
Copy link

@Tratcher the reason I am commenting here is because MongoDB still has this issue linked to their Atlas configuration page. I'm just trying to help anyone who lands here from that page navigate the waters by pointing out that the SNI works on Windows and on the Debian Stretch Docker image for 2.1 but not on OSX and the Alpine Linux images.

Yes they use TLS SNI on the 3.6 driver on Atlas to connect to all the members of the replica set. I am glad to start a new issue as well.

@karelz
Copy link
Member

karelz commented Jun 30, 2018

@buvinghausen please link the new issue you created / are going to create

MorganPeat referenced this issue in MorganPeat/CryptoTracker Aug 17, 2018
More info here: https://github.com/dotnet/corefx/issues/9608

"we experience problems with the MongoDB 3.6 connection string to Atlas on both OSX and the Linux Alpine Docker image. It works great on Windows and it works great on the Debian Stretch Docker image. "
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-needs-work API needs work before it is approved, it is NOT ready for implementation area-System.Net
Projects
None yet
Development

No branches or pull requests