Only overwrite servername in tls connect when host is not an IP address #354
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an alternative to #337 (which was created to revert #312).
Based on the original report in #308, I think reverting is not ideal since it would (re-)break the use case described where Kubernetes issues certificates for hosts that area reachable by IP. (Kubernetes is not an area I have much experience in so this is reiterating the original report but I have not tested this.)
But I do think the end result of #337 is nice in that it removes the warning for a common use case. Regardless of Node showing a deprecation warning and RFC 6066, it would be nice not to show the warning since even the tests in this repo trigger the deprecation message.
I searched a bit and found an example of
node-postres
handling this same issue with a solution that accounts for both situations: brianc/node-postgres#1890This PR copies that code into a helper function used in all places that
net.isIP
was used.Closes #337.