getCACertificates
Returns an array containing the CA certificates from various sources, depending on type
:
"default"
: return the CA certificates that will be used by the Node.js TLS clients by default.When
--use-bundled-ca
is enabled (default), or--use-openssl-ca
is not enabled, this would include CA certificates from the bundled Mozilla CA store.When
--use-system-ca
is enabled, this would also include certificates from the system's trusted store.When
NODE_EXTRA_CA_CERTS
is used, this would also include certificates loaded from the specified file."system"
: return the CA certificates that are loaded from the system's trusted store, according to rules set by--use-system-ca
. This can be used to get the certificates from the system when--use-system-ca
is not enabled."bundled"
: return the CA certificates from the bundled Mozilla CA store. This would be the same astls.rootCertificates
."extra"
: return the CA certificates loaded fromNODE_EXTRA_CA_CERTS
. It's an empty array ifNODE_EXTRA_CA_CERTS
is not set.
Since
v22.15.0
Parameters
The type of CA certificates that will be returned. Valid values are "default"
, "system"
, "bundled"
and "extra"
. Default: "default"
.