Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I configure NPM to Trust the firewall issuer for HTTPS proxying?

I am attempting to use NPM in an environment behind a corporate firewall. Said firewall intercepts all https traffic and signs it with its' own CA... Is there a way to "trust" this CA so that NPM can actually work?

like image 542
Tracker1 Avatar asked Jun 10 '13 22:06

Tracker1


People also ask

How do I fix SSL certificate error when running NPM Windows?

Solutions: Use wget https://registry.npmjs.org/coffee-script --ca-certificate=./DigiCertHighAssuranceEVRootCA. crt to fix wget problem. Use npm config set cafile /path/to/DigiCertHighAssuranceEVRootCA.

How do I find my NPM proxy settings?

Open Settings > System > Open Proxy Settings > LAN Settings In LAN Settings you can find the proxy server and its port no.


2 Answers

There is better way to configure npm to trust certificates issued by a specific CA.

npm config -g set cafile /path/to/myCA.cert

This will add this CA (probably your company's self signed certificate) to the npm's trusted CA's. With this solution, you get the benefit of SSL key validation and adding your own CA entities.

like image 105
Josep Prat Avatar answered Oct 11 '22 00:10

Josep Prat


NOTE: This solution should not generally be used, see Josep's answer above as well as This Answer from comments. This question and answer were before the cafile options, iirc. Also, in my case it was behind a corporate proxy that self-signed everything anyway.

Old/Deprecated answer below.


Found the solution... (Ignoring SSL Certs)

npm config -g set strict-ssl false

Thanks to this thread in google groups.

like image 7
Tracker1 Avatar answered Oct 11 '22 00:10

Tracker1