@@ -2509,24 +2509,38 @@ or it might contain wildcards (e.g., `*.example.com`). Because host name
25092509comparisons are case-insensitive, the returned subject name might also differ
25102510from the given ` name ` in capitalization.
25112511
2512- ### ` x509.checkIP(ip[, options]) `
2512+ If the ` 'subject' ` option is set to ` 'always' ` and if the subject alternative
2513+ name extension either does not exist or does not contain a matching DNS name,
2514+ the certificate subject is considered.
2515+
2516+ If the ` 'subject' ` option is set to ` 'default' ` , the certificate subject is only
2517+ considered if the subject alternative name extension either does not exist or
2518+ does not contain any DNS names. This behavior is consistent with [ RFC 2818] [ ]
2519+ ("HTTP Over TLS").
2520+
2521+ If the ` 'subject' ` option is set to ` 'never' ` , the certificate subject is never
2522+ considered, even if the certificate contains no subject alternative names.
2523+
2524+ ### ` x509.checkIP(ip) `
25132525
25142526<!-- YAML
25152527added: v15.6.0
2528+ changes:
2529+ - version: REPLACEME
2530+ pr-url: https://github.com/nodejs/node/pull/41571
2531+ description: The `options` argument has been removed since it had no effect.
25162532-->
25172533
25182534* ` ip ` {string}
2519- * ` options ` {Object}
2520- * ` subject ` {string} ` 'always' ` or ` 'never' ` . ** Default:** ` 'always' ` .
2521- * ` wildcards ` {boolean} ** Default:** ` true ` .
2522- * ` partialWildcards ` {boolean} ** Default:** ` true ` .
2523- * ` multiLabelWildcards ` {boolean} ** Default:** ` false ` .
2524- * ` singleLabelSubdomains ` {boolean} ** Default:** ` false ` .
25252535* Returns: {string|undefined} Returns ` ip ` if the certificate matches,
25262536 ` undefined ` if it does not.
25272537
25282538Checks whether the certificate matches the given IP address (IPv4 or IPv6).
25292539
2540+ Only [ RFC 5280] [ ] ` iPAddress ` subject alternative names are considered, and they
2541+ must match the given ` ip ` address exactly. Other subject alternative names as
2542+ well as the subject field of the certificate are ignored.
2543+
25302544### ` x509.checkIssued(otherCert) `
25312545
25322546<!-- YAML
@@ -5911,6 +5925,7 @@ See the [list of SSL OP Flags][] for details.
59115925[ RFC 4055 ] : https://www.rfc-editor.org/rfc/rfc4055.txt
59125926[ RFC 4122 ] : https://www.rfc-editor.org/rfc/rfc4122.txt
59135927[ RFC 5208 ] : https://www.rfc-editor.org/rfc/rfc5208.txt
5928+ [ RFC 5280 ] : https://www.rfc-editor.org/rfc/rfc5280.txt
59145929[ Web Crypto API documentation ] : webcrypto.md
59155930[ `BN_is_prime_ex` ] : https://www.openssl.org/docs/man1.1.1/man3/BN_is_prime_ex.html
59165931[ `Buffer` ] : buffer.md
0 commit comments