Jerry
Jerry

Reputation: 91

Getting UNABLE_TO_VERIFY_LEAF_SIGNATURE from NPM when installing hexo-cli

I am getting an UNABLE_TO_VERIFY_LEAF_SIGNATURE error when I try to install hexo-cli on Windows. I have tried switching to another mirror but that did not fix the problem.

enter image description here

Upvotes: 7

Views: 20409

Answers (2)

flags
flags

Reputation: 521

Please, follow instructions described here:

How to fix SSL certificate error when running Npm on Windows?

As the author suggests, the point here to use NODE_EXTRA_CA_CERTS environment variable. Keep in mind that setting npm config set cafile <path> causes npm to only use the certs provided in that file, instead of extending the existing ones with it.

Upvotes: 0

Carlos Sultana
Carlos Sultana

Reputation: 709

Are you behind a corporate proxy? They are most likely intercepting & MiTM'ing the traffic with a self signed SSL certificate.

A hacky solution is just to turn off SSL for NPM

npm set strict-ssl false

More detailed instructions can be found here: How to fix SSL certificate error when running Npm on Windows?

References:

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

Upvotes: 9

Related Questions