CNode

npm install 出错,已经找到原因了,但不太理解。。

Aandy24boyking发布于12 年前最后回复12 年前5 回复35068 浏览0 收藏

今天在ubuntu下用npm install一个工具,报了如下错误

Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN

在网上搜了下,已经找到了解释 Npm's Self-Signed Certificate is No More。不过我不是太理解,希望各位大神能够解释一下,谢谢!

查看回复

回复 (5)

G
GuoZhang#1·12 年前

没有遇到过这个问题。简单查了一下:

As of February 27, 2014, npm no longer supports its self-signed certificates. 2014年2月27日,npm不再支持自签名证书。

The current stable version of node includes an npm client that is not affected by this issue. 当前Node的稳定版本包含的npm客户端不受影响。

所以,你使用的npm客户端使用了npm的自签名证书。 所以文章推荐的做法: 1). upgrade your version of npm 升级npm客户端, 升级的时候也不要使用自签名证书 npm install npm -g --ca=null 或 2). tell your current version of npm to use known registrars 如果你不打算升级npm客户端的话 npm config set ca=""

更多关于此问题的帮助: http://blog.npmjs.org/post/78165272245/more-help-with-self-signed-cert-in-chain-and-npm

K
kingapple#2·12 年前

赶脚是伟大的樯在召唤楼主:)

A
andy24boyking#3·12 年前
引用 GuoZhang没有遇到过这个问题。简单查了一下: As of February 27, 2014, npm no longer supports its self signed certificates. ...

非常感谢!请问自签名证书是什么意思啊。。我只是顺带一问~我自己也会再查查的。。

G
GuoZhang#4·12 年前
引用 GuoZhang没有遇到过这个问题。简单查了一下: As of February 27, 2014, npm no longer supports its self signed certificates. ...

@andy24boyking 你看npm install的时候都是走https协议,https协议建立的是安全连接。这个安全是通过数字证书来保证的,数字证书就是公钥/私钥对中的公钥。数据从服务器传到客户端前需要服务器用其私钥加密,客户端收到后用服务器的数字证书来解密。 数字证书的颁发需要专门的机构(CA),这些机构会收取一定的费用(通常按年收费)。如果不想给这笔费用,就自己扮演颁发数字证书的机构,自己给自己颁发数字证书,此为自签名证书。

参与回复
登录后即可参与回复。登录