How to import a self-signed root cert to npm?

73 views
Skip to first unread message

Jirong Hu

unread,
Oct 19, 2015, 8:41:14 PM10/19/15
to nodejs
Our company has WebSense installed and using a self-signed root cert, so all my SSL requests going out failed. I fixed the issue by importing that cert into my Java keystore, but how to do this for npm? I suspect the following error is due to this cert. The security dept told me there is no proxy installed.

C:\OTPPB2015\Workspace\JavaScript\scapegoat>npm install mocha --save-dev
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Tools\\nodejs\\node.exe" "C:\\Tools\\nodejs\\node_modules\\npm\\bin\\npm-cli.js"
"install" "mocha" "--save-dev"
npm ERR! node v4.1.1
npm ERR! npm  v2.14.4
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! syscall connect

npm ERR! Error: connect ECONNREFUSED 172.21.85.31:80
npm ERR!     at Object.exports._errnoException (util.js:837:11)
npm ERR!     at exports._exceptionWithHostPort (util.js:860:20)
npm ERR!     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1060:14)
npm ERR!  { [Error: connect ECONNREFUSED 172.21.85.31:80]
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   syscall: 'connect',
npm ERR!   address: '172.21.85.31',
npm ERR!   port: 80,
npm ERR!   parent: 'scapegoat' }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR!     C:\OTPPB2015\Workspace\JavaScript\scapegoat\npm-debug.log

Aria Stewart

unread,
Oct 19, 2015, 10:50:50 PM10/19/15
to nod...@googlegroups.com

> On Oct 19, 2015, at 11:30 AM, Jirong Hu <jiro...@gmail.com> wrote:
>
> Our company has WebSense installed and using a self-signed root cert, so all my SSL requests going out failed. I fixed the issue by importing that cert into my Java keystore, but how to do this for npm? I suspect the following error is due to this cert. The security dept told me there is no proxy installed.

Nope -- ECONNREFUSED would be before SSL is even negotiated.

But if you have a proxy configured, but no longer installed, this error would result.

Reply all
Reply to author
Forward
0 new messages