You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bf871bf
Browse filesBrowse the repository at this point in the historyBrowse files
* fix: omit SNI for IP-based hostnames
Refs: #1237
* fix: preserve server identity check when omitting SNI
When a socket is passed to `tls.connect()` without a `host` option,
the certificate identity check falls back to `options.servername ||
options.host || options.socket._host || 'localhost'`. Setting
`servername` to an empty string for IP addresses therefore caused the
server's certificate to be validated against `'localhost'` instead of
the IP address, breaking connections to IP addresses that use
`trustServerCertificate: false` with a certificate carrying matching
`IP Address` SANs.
Pass the target host explicitly so that certificate validation keeps
using it while the SNI extension remains omitted for IP addresses.
The IPv6 test is skipped on Node.js versions affected by
nodejs/node#64144, where
`tls.checkServerIdentity()` cannot match IPv6 addresses against
`IP Address` SANs at all.
Co-Authored-By: Claude Fable 5 <[email protected]>
* test: align `servername` type widening with newer `@types/node`
Recent `@types/node` versions declare the server-side `servername`
getter on `TLSSocket` as `string | false | null`, which is incompatible
with the `servername?: string` widening under
`exactOptionalPropertyTypes`. Use the same union so the test compiles
against both older and newer type definitions.
Co-Authored-By: Claude Fable 5 <[email protected]>
* test: drop `servername` type widening
Now that the branch is on current `master`, whose lockfile pins
`@types/node` 26, the server-side `servername` getter is declared on
`TLSSocket` directly and the widening is no longer needed.
Co-Authored-By: Claude Fable 5 <[email protected]>
---------
Co-authored-by: Arthur Schreiber <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
0 commit comments