tls.rootCertificates


不可变的字符串数组,代表当前 Node.js 版本提供的打包 Mozilla CA 存储中的根证书(PEM 格式)。

¥An immutable array of strings representing the root certificates (in PEM format) from the bundled Mozilla CA store as supplied by the current Node.js version.

Node.js 提供的打包 CA 存储是 Mozilla CA 存储的快照,在发布时已修复。它在所有支持的平台上都是相同的。

¥The bundled CA store, as supplied by Node.js, is a snapshot of Mozilla CA store that is fixed at release time. It is identical on all supported platforms.

要获取当前 Node.js 实例使用的实际 CA 证书(可能包括从系统存储加载的证书(如果使用 --use-system-ca)或从 NODE_EXTRA_CA_CERTS 指示的文件加载的证书),请使用 tls.getCACertificates()

¥To get the actual CA certificates used by the current Node.js instance, which may include certificates loaded from the system store (if --use-system-ca is used) or loaded from a file indicated by NODE_EXTRA_CA_CERTS, use tls.getCACertificates().