tls: emit a warning when servername is an IP address by rcombs · Pull Request #18127 · nodejs/node

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with === false to match an existing one-time warning (dunno if it optimizes slightly better or what); I can switch to ! if you prefer.

url.parse('https://[fe80::a00:27ff:fec0:eb1a]:3333/'), for instance, fills hostname with fe80::a00:27ff:fec0:eb1a (bracketless), and if you manually build a URL with brackets around an IPv6 address in hostname, https.get() on it fails on DNS lookup, so I think we should be fine there?