Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm publish on a private server throw error "UNABLE_TO_VERIFY_LEAF_SIGNATURE". But I can curl through SSL the server

Tags:

npm

ssl

FYI my certificate is trusted by GeoTrust SSL CA.

I do the following command :

npm adduser --registry https://npm.****.fr and the error thrown is UNABLE_TO_VERIFY_LEAF_SIGNATURE.

I did a lot of test to fix it.

  1. I try with curl and fix the issue by adding my website CRT on system (/usr/share/ca-certificates/extra/***.crt then dpkg-reconfigure ca-certificates). The same error occured on NPM.
  2. I try to specify option ca, cafile, cert, nothing change.
  3. If I provide the option strictssl=false, it works but I don't really like this option...

Any ideas ?

like image 859
Cyril ALFARO Avatar asked Oct 28 '25 01:10

Cyril ALFARO


1 Answers

I had a similar issue, following command did the trick:

npm config set strict-ssl false
export NODE_TLS_REJECT_UNAUTHORIZED=0
like image 57
Kalpesh Panchal Avatar answered Oct 30 '25 15:10

Kalpesh Panchal