【发布时间】:2015-12-04 13:23:38
【问题描述】:
我在个人服务器上有一个 git repo,它使用自签名证书。
我想做的是将此 CA 添加到 npm 的受信任的 CA,以便像这样从 repo 安装包:
npm install git+https://domain.tld/repo.git
以下命令允许我信任我的服务器,但之后,我的本地 npm 不再信任 npm.org 存储库。
npm config set cafile=/usr/local/share/ca-certificates/domain.tld/ca.crt
npm config set ca="content-of-my-cert"
NB:它适用于git+ssh://,但由于其他人会使用此包,我不想每次有新消费者时都添加新的受信任的 ssh 密钥...
【问题讨论】:
标签: node.js git ssl npm ssl-certificate