@@ -2471,11 +2471,16 @@ added: v15.6.0
24712471
24722472<!-- YAML
24732473added: v15.6.0
2474+ changes:
2475+ - version: REPLACEME
2476+ pr-url: https://github.com/nodejs/node/pull/41569
2477+ description: The subject option can now be set to `'default'`.
24742478-->
24752479
24762480* ` email ` {string}
24772481* ` options ` {Object}
2478- * ` subject ` {string} ` 'always' ` or ` 'never' ` . ** Default:** ` 'always' ` .
2482+ * ` subject ` {string} ` 'default' ` , ` 'always' ` , or ` 'never' ` .
2483+ ** Default:** ` 'always' ` .
24792484 * ` wildcards ` {boolean} ** Default:** ` true ` .
24802485 * ` partialWildcards ` {boolean} ** Default:** ` true ` .
24812486 * ` multiLabelWildcards ` {boolean} ** Default:** ` false ` .
@@ -2485,15 +2490,31 @@ added: v15.6.0
24852490
24862491Checks whether the certificate matches the given email address.
24872492
2493+ If the ` 'subject' ` option is set to ` 'always' ` and if the subject alternative
2494+ name extension either does not exist or does not contain a matching email
2495+ address, the certificate subject is considered.
2496+
2497+ If the ` 'subject' ` option is set to ` 'default ` ', the certificate subject is only
2498+ considered if the subject alternative name extension either does not exist or
2499+ does not contain any email addresses.
2500+
2501+ If the ` 'subject' ` option is set to ` 'never' ` , the certificate subject is never
2502+ considered, even if the certificate contains no subject alternative names.
2503+
24882504### ` x509.checkHost(name[, options]) `
24892505
24902506<!-- YAML
24912507added: v15.6.0
2508+ changes:
2509+ - version: REPLACEME
2510+ pr-url: https://github.com/nodejs/node/pull/41569
2511+ description: The subject option can now be set to `'default'`.
24922512-->
24932513
24942514* ` name ` {string}
24952515* ` options ` {Object}
2496- * ` subject ` {string} ` 'always' ` or ` 'never' ` . ** Default:** ` 'always' ` .
2516+ * ` subject ` {string} ` 'default' ` , ` 'always' ` , or ` 'never' ` .
2517+ ** Default:** ` 'always' ` .
24972518 * ` wildcards ` {boolean} ** Default:** ` true ` .
24982519 * ` partialWildcards ` {boolean} ** Default:** ` true ` .
24992520 * ` multiLabelWildcards ` {boolean} ** Default:** ` false ` .
@@ -2509,6 +2530,18 @@ or it might contain wildcards (e.g., `*.example.com`). Because host name
25092530comparisons are case-insensitive, the returned subject name might also differ
25102531from the given ` name ` in capitalization.
25112532
2533+ If the ` 'subject' ` option is set to ` 'always' ` and if the subject alternative
2534+ name extension either does not exist or does not contain a matching DNS name,
2535+ the certificate subject is considered.
2536+
2537+ If the ` 'subject' ` option is set to ` 'default' ` , the certificate subject is only
2538+ considered if the subject alternative name extension either does not exist or
2539+ does not contain any DNS names. This behavior is consistent with [ RFC 2818] [ ]
2540+ ("HTTP Over TLS").
2541+
2542+ If the ` 'subject' ` option is set to ` 'never' ` , the certificate subject is never
2543+ considered, even if the certificate contains no subject alternative names.
2544+
25122545### ` x509.checkIP(ip[, options]) `
25132546
25142547<!-- YAML
@@ -5933,6 +5966,7 @@ See the [list of SSL OP Flags][] for details.
59335966[ OpenSSL's SPKAC implementation ] : https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html
59345967[ RFC 1421 ] : https://www.rfc-editor.org/rfc/rfc1421.txt
59355968[ RFC 2412 ] : https://www.rfc-editor.org/rfc/rfc2412.txt
5969+ [ RFC 2818 ] : https://www.rfc-editor.org/rfc/rfc2818.txt
59365970[ RFC 3526 ] : https://www.rfc-editor.org/rfc/rfc3526.txt
59375971[ RFC 3610 ] : https://www.rfc-editor.org/rfc/rfc3610.txt
59385972[ RFC 4055 ] : https://www.rfc-editor.org/rfc/rfc4055.txt
0 commit comments