NODE_EXTRA_CA_CERTS=file


设置后,知名的“根”证书颁发机构(如 VeriSign)将会使用 file 中的额外证书进行扩展。该文件应包含一个或多个 PEM 格式的受信任证书。如果文件缺失或格式错误,将会(仅一次)发出 process.emitWarning() 消息,但其他任何错误将被忽略。

【When set, the well known "root" CAs (like VeriSign) will be extended with the extra certificates in file. The file should consist of one or more trusted certificates in PEM format. A message will be emitted (once) with process.emitWarning() if the file is missing or malformed, but any errors are otherwise ignored.】

当为 TLS 或 HTTPS 客户端或服务器显式指定 ca 选项属性时,既不会使用知名证书,也不会使用额外证书。

【Neither the well known nor extra certificates are used when the ca options property is explicitly specified for a TLS or HTTPS client or server.】

node 以 setuid root 运行或设置了 Linux 文件能力时,此环境变量将被忽略。

【This environment variable is ignored when node runs as setuid root or has Linux file capabilities set.】

NODE_EXTRA_CA_CERTS 环境变量只在 Node.js 进程首次启动时读取。运行时使用 process.env.NODE_EXTRA_CA_CERTS 更改其值不会影响当前进程。

【The NODE_EXTRA_CA_CERTS environment variable is only read when the Node.js process is first launched. Changing the value at runtime using process.env.NODE_EXTRA_CA_CERTS has no effect on the current process.】