@@ -2472,6 +2472,9 @@ added: v15.6.0
2472
2472
<!-- YAML
2473
2473
added: v15.6.0
2474
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'`.
2475
2478
- version: v16.14.1
2476
2479
pr-url: https://github.com/nodejs/node/pull/41599
2477
2480
description: The `wildcards`, `partialWildcards`, `multiLabelWildcards`, and
@@ -2481,21 +2484,42 @@ changes:
2481
2484
2482
2485
* ` email ` {string}
2483
2486
* ` options ` {Object}
2484
- * ` subject ` {string} ` 'always' ` or ` 'never' ` . ** Default:** ` 'always' ` .
2487
+ * ` subject ` {string} ` 'default' ` , ` 'always' ` , or ` 'never' ` .
2488
+ ** Default:** ` 'always' ` .
2489
+ * ` wildcards ` {boolean} ** Default:** ` true ` .
2490
+ * ` partialWildcards ` {boolean} ** Default:** ` true ` .
2491
+ * ` multiLabelWildcards ` {boolean} ** Default:** ` false ` .
2492
+ * ` singleLabelSubdomains ` {boolean} ** Default:** ` false ` .
2485
2493
* Returns: {string|undefined} Returns ` email ` if the certificate matches,
2486
2494
` undefined ` if it does not.
2487
2495
2488
2496
Checks whether the certificate matches the given email address.
2489
2497
2498
+ If the ` 'subject' ` option is set to ` 'always' ` and if the subject alternative
2499
+ name extension either does not exist or does not contain a matching email
2500
+ address, the certificate subject is considered.
2501
+
2502
+ If the ` 'subject' ` option is set to ` 'default ` ', the certificate subject is only
2503
+ considered if the subject alternative name extension either does not exist or
2504
+ does not contain any email addresses.
2505
+
2506
+ If the ` 'subject' ` option is set to ` 'never' ` , the certificate subject is never
2507
+ considered, even if the certificate contains no subject alternative names.
2508
+
2490
2509
### ` x509.checkHost(name[, options]) `
2491
2510
2492
2511
<!-- YAML
2493
2512
added: v15.6.0
2513
+ changes:
2514
+ - version: REPLACEME
2515
+ pr-url: https://github.com/nodejs/node/pull/41569
2516
+ description: The subject option can now be set to `'default'`.
2494
2517
-->
2495
2518
2496
2519
* ` name ` {string}
2497
2520
* ` options ` {Object}
2498
- * ` subject ` {string} ` 'always' ` or ` 'never' ` . ** Default:** ` 'always' ` .
2521
+ * ` subject ` {string} ` 'default' ` , ` 'always' ` , or ` 'never' ` .
2522
+ ** Default:** ` 'always' ` .
2499
2523
* ` wildcards ` {boolean} ** Default:** ` true ` .
2500
2524
* ` partialWildcards ` {boolean} ** Default:** ` true ` .
2501
2525
* ` multiLabelWildcards ` {boolean} ** Default:** ` false ` .
@@ -2511,6 +2535,18 @@ or it might contain wildcards (e.g., `*.example.com`). Because host name
2511
2535
comparisons are case-insensitive, the returned subject name might also differ
2512
2536
from the given ` name ` in capitalization.
2513
2537
2538
+ If the ` 'subject' ` option is set to ` 'always' ` and if the subject alternative
2539
+ name extension either does not exist or does not contain a matching DNS name,
2540
+ the certificate subject is considered.
2541
+
2542
+ If the ` 'subject' ` option is set to ` 'default' ` , the certificate subject is only
2543
+ considered if the subject alternative name extension either does not exist or
2544
+ does not contain any DNS names. This behavior is consistent with [ RFC 2818] [ ]
2545
+ ("HTTP Over TLS").
2546
+
2547
+ If the ` 'subject' ` option is set to ` 'never' ` , the certificate subject is never
2548
+ considered, even if the certificate contains no subject alternative names.
2549
+
2514
2550
### ` x509.checkIP(ip) `
2515
2551
2516
2552
<!-- YAML
@@ -5896,6 +5932,7 @@ See the [list of SSL OP Flags][] for details.
5896
5932
[ OpenSSL's SPKAC implementation ] : https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html
5897
5933
[ RFC 1421 ] : https://www.rfc-editor.org/rfc/rfc1421.txt
5898
5934
[ RFC 2412 ] : https://www.rfc-editor.org/rfc/rfc2412.txt
5935
+ [ RFC 2818 ] : https://www.rfc-editor.org/rfc/rfc2818.txt
5899
5936
[ RFC 3526 ] : https://www.rfc-editor.org/rfc/rfc3526.txt
5900
5937
[ RFC 3610 ] : https://www.rfc-editor.org/rfc/rfc3610.txt
5901
5938
[ RFC 4055 ] : https://www.rfc-editor.org/rfc/rfc4055.txt
0 commit comments