安装 hexo-cli 时从 NPM 获取 UNABLE_TO_VERIFY_LEAF_SIGNATURE

问题描述 投票:0回答:3

当我尝试在 Windows 上安装 hexo-cli 时,出现

UNABLE_TO_VERIFY_LEAF_SIGNATURE
错误。我尝试切换到另一个镜子,但这并没有解决问题。

node.js windows npm
3个回答
9
投票

您有公司代理吗?他们很可能使用自签名 SSL 证书拦截和中间人攻击流量。

一个 hacky 解决方案就是关闭 NPM 的 SSL

npm set strict-ssl false

更详细的说明可以在这里找到:如何修复在 Windows 上运行 Npm 时的 SSL 证书错误?

参考文献:

https://github.com/Medium/phantomjs#i-am-behind-a-corporate-proxy-that-uses-self-signed-ssl-certificates-to-intercept-encrypted-traffic

https://security.stackexchange.com/questions/101721/is-it-possible-for-corporation-to-intercept-and-decrypt-ssl-tls-traffic


0
投票

请按照此处描述的说明进行操作:

如何修复在 Windows 上运行 Npm 时出现 SSL 证书错误?

正如作者建议的,这里使用

NODE_EXTRA_CA_CERTS
环境变量。请记住,设置
npm config set cafile <path>
会导致
npm
仅使用该文件中提供的证书,而不是用它扩展现有的证书。


0
投票

对于使用 ESET Smart Security 互联网安全的任何人

检查 SSL/TSL 连接

https://forum.eset.com/topic/40702-eset-ssl-protection-products-an-invalid-certificate-chain-for-nodejs-apps/

© www.soinside.com 2019 - 2024. All rights reserved.