tls: add "ca" property to certificate object

The objects returned by getPeerCertificate() now have an additional "ca"
boolean property that indicates whether the certificate is a Certificate
Authority certificate or not.

Fixes: https://github.com/nodejs/node/issues/44905
PR-URL: https://github.com/nodejs/node/pull/44935
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <midawson@redhat.com>
This commit is contained in:
Ben Noordhuis authored and RafaelGSS committed 2022-11-10 09:45:37 -03:00
1 parent 0e9bad97cc
commit bf868fdfab
4 files changed
+12 -1

No files matched your search

+4
View File
@@ -1173,6 +1173,9 @@ certificate.
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44935
description: Add "ca" property.
- version:
- v17.2.0
- v16.14.0
@@ -1186,6 +1189,7 @@ changes:
A certificate object has properties corresponding to the fields of the
certificate.
* `ca` {boolean} `true` if a Certificate Authority (CA), `false` otherwise.
* `raw` {Buffer} The DER encoded X.509 certificate data.
* `subject` {Object} The certificate subject, described in terms of
Country (`C`), StateOrProvince (`ST`), Locality (`L`), Organization (`O`),