-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
SNI is incorrectly set to IP addresses using the https module #18071
Comments
@rcombs I think both options 2 & 3 are okay, and I’d have a preference for option 2 for the reason you mentioned. Would you be willing to open a PR yourself? |
Since it's not permitted in the RFC, we might as well throw an error if |
People use SNI with IP addresses, see #14736. That means we can't just silently break it. |
That issue seems to be around SAN handling, not (deliberately) about SNI? |
Not deliberately, no. |
Sounds like it should be fine to drop SNI for IPs, then, as long as we make sure not to break verification of IP certs? |
What I mean is that I don't think their use case could work if the IP address wasn't forwarded in the SNI record. And if not them specifically, then it's probably still true for others since node.js (and openssl-based servers in general) accept addresses. In case of doubt we usually start by emitting warnings for a while. That gives users time to update their code and doubles as a kind of poor man's telemetry - people tend to open issues about features dear to their hearts. If there are pressing concerns, like if there were security implications, we could take a shortcut but I don't think that's the case here. |
Servers generally treat connections without SNI as if the hostname were the IP address the connection was made to for the purposes of vhosts and such; if there's a case that requires this, it's a buggy server that's only used with a node client (as I'm not aware of any other HTTPS stacks that do this; certainly not libcurl or any major browser). |
Yes, that's sounds like the way forward. That could land in node 10 and probably node 9. |
I'm slightly concerned that this could lead to warning spam for people who e.g. pass in a string (i.e. aren't clearly intending to trigger SNI). Is there a common pattern for one-time warnings? |
Yep. Nothing fancy, see 560f797 for an example. |
Setting the TLS ServerName to an IP address is not permitted by RFC6066. This will be ignored in a future version. Closes: nodejs#18071 Refs: nodejs#18127
Example code:
If you have a server listening on 8888, it will receive a TLS ClientHello containing a ServerName extension indicating the IPv4 address literal
127.0.0.1
. RFC 6066 states:This can cause unexpected results depending on how the server handles invalid or unexpected SNI, which may be different from the no-SNI case (which is what's expected here).
I can imagine about three ways to address this:
The text was updated successfully, but these errors were encountered: