Skip to content

Commit 8348499

Browse files
tniessenguangwong
authored andcommittedOct 10, 2022
doc: suggest checkHost in checkServerIdentity docs
Refs: nodejs/node#42470 PR-URL: nodejs/node#42495 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]>

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
@@ -1513,6 +1513,11 @@ Verifies the certificate `cert` is issued to `hostname`.
15131513
Returns {Error} object, populating it with `reason`, `host`, and `cert` on
15141514
failure. On success, returns {undefined}.
15151515

1516+
This function is intended to be used in combination with the
1517+
`checkServerIdentity` option that can be passed to [`tls.connect()`][] and as
1518+
such operates on a [certificate object][]. For other purposes, consider using
1519+
[`x509.checkHost()`][] instead.
1520+
15161521
This function can be overwritten by providing an alternative function as the
15171522
`options.checkServerIdentity` option that is passed to `tls.connect()`. The
15181523
overwriting function can call `tls.checkServerIdentity()` of course, to augment
@@ -2243,6 +2248,7 @@ added: v11.4.0
22432248
[`tls.createServer()`]: #tlscreateserveroptions-secureconnectionlistener
22442249
[`tls.getCiphers()`]: #tlsgetciphers
22452250
[`tls.rootCertificates`]: #tlsrootcertificates
2251+
[`x509.checkHost()`]: crypto.md#x509checkhostname-options
22462252
[asn1.js]: https://www.npmjs.com/package/asn1.js
22472253
[certificate object]: #certificate-object
22482254
[cipher list format]: https://www.openssl.org/docs/man1.1.1/man1/ciphers.html#CIPHER-LIST-FORMAT

0 commit comments

Comments
 (0)
Please sign in to comment.