nodejs / nodejs/node

NODE_EXTRA_CA_CERTS does not work when set in env file

未关闭
#51,426 11 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

confirmed-bug dotenv
主要语言
JavaScript
星标
122k
派生
37.4k
平均合并
4 天 3 小时
30 天内合并 PR
272

描述

Version

v21.5.0

Platform

Darwin MACM-YXGQWMKDQK 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000 arm64

Subsystem

No response

What steps will reproduce the bug?

Run
node --env-file ./config/.env.development

With env file containing NODE_EXTRA_CA_CERTS

The variable is not taken into account.

Run same script but exporting the variable first, it is correctly taken into account.

How often does it reproduce? Is there a required condition?

Always!

What is the expected behavior? Why is that the expected behavior?

The ca cert should be taken into account

What do you see instead?

It is not correctly taken into account and I get errors about self signed certificates

Additional information

No response

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先使用 node --env-file ./config/.env.development 和包含 NODE_EXTRA_CA_CERTS 的 env 文件复现该问题,然后将其与在运行同一脚本之前导出该变量的情况进行比较。完成的标准是从 env 文件加载证书时证书能够生效,并且不再出现自签名证书错误。

由索引模型根据 Issue 内容生成。

评估

技术栈
node.js
领域
backend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。