Skip to content

Commit 1766dd4

Browse files
committed
doc: suggest checkHost in checkServerIdentity docs
Refs: #42470
1 parent a7697c5 commit 1766dd4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/api/tls.md

+6
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,11 @@ Verifies the certificate `cert` is issued to `hostname`.
15251525
Returns {Error} object, populating it with `reason`, `host`, and `cert` on
15261526
failure. On success, returns {undefined}.
15271527

1528+
This function is intended to be used in combination with the
1529+
`checkServerIdentity` option that can be passed to [`tls.connect()`][] and as
1530+
such operates on a [certificate object][]. For other purposes, consider using
1531+
[`x509.checkHost()`][] instead.
1532+
15281533
This function can be overwritten by providing an alternative function as the
15291534
`options.checkServerIdentity` option that is passed to `tls.connect()`. The
15301535
overwriting function can call `tls.checkServerIdentity()` of course, to augment
@@ -2257,6 +2262,7 @@ added: v11.4.0
22572262
[`tls.createServer()`]: #tlscreateserveroptions-secureconnectionlistener
22582263
[`tls.getCiphers()`]: #tlsgetciphers
22592264
[`tls.rootCertificates`]: #tlsrootcertificates
2265+
[`x509.checkHost()`]: crypto.md#x509checkhostname-options
22602266
[asn1.js]: https://www.npmjs.com/package/asn1.js
22612267
[certificate object]: #certificate-object
22622268
[cipher list format]: https://www.openssl.org/docs/man1.1.1/man1/ciphers.html#CIPHER-LIST-FORMAT

0 commit comments

Comments
 (0)