Self signed certificate error with NPM - jrcloudsolutions/tidbits GitHub Wiki
When using the NPM package manager in Powershell to try to publish an npm package from the runner into my private project package registry, we were getting a self-signed certificate error and then a 400 authentication error:
-
To fix the self-signed certificate error: 1.1 We configured npm to ignore SSL certificates with "npm config set strict-ssl false" and the self-signed cert error went away 1.2 Then, we set it back to "true", and copied the GitLab platform root cert i.e. DoDRoot3.crt into a local directory where npm was installed i.e. c:\users\jose\npm 1.3 Then, set the following statement to map the cert c:\users\jose\npm\DoDRoot3.crt with npm config set cafile "c:\users\jose\npm\DoDRoot3.crt" 1.4 Then, view it with "npm config list" Note that only the root certificate needed to be configured, no intermediate or load balancer
-
To fix the 400 authentication error: 1.2 we needed to modify the .npm configuration file with a valid project PAT
Note: The NPM package manager does not use the Windows certificate store, the root cert needs to be manually configured with "npm confif set cafile....."