Share this article
Improve this guide
How to Fix Self-Signed Certificate in Certificate Chain Error
2 min. read
Updated onOctober 4, 2023
updated onOctober 4, 2023
Share this article
Improve this guide
Read our disclosure page to find out how can you help Windows Report sustain the editorial teamRead more
Key notes
For some time now, developers encountered a SELF_SIGNED_CERT_IN_CHAIN error during installing and publishing packages in certain applications and developer toolssuch as Node.js, npm, or Git.
Until a few years ago, when npm for instance announced that they would no longer support self-signed certificates.
This means that the certificate verification process was no longer automatic. So developers now have to set up their application to see the self-signed certificates.
How do I fix self-signed certificate in the certificate chain?
Depending on the tool you’re using, there are a few recommendations. Some are risky, some are safe. One thing is clear, though: you should not attempt to disable the certification verification process altogether.
For Node.js
You can insert an environment variable toallow untrusted certificates using the following command at the beginning of the code:
This is risky and it’s not recommended to be used in production. Alternatively, usenpm config set strict-ssl=falseif you have to do this for many applications and you want to save repeating the process.
Users also suggest upgradingyour version of Node, to fixes any existing bugs and vulnerabilities.
For npm
The recommended solution is, again, to upgrade your version of npm running one of the following:
npm install npm -g –ca=null
npm update npm-gOr,tell your current version of npm to use known registrars, and after installing, stop using them:
Some users mentioned that they onlyswitched the registry URL from https to http:
We hope that one of these suggestions helped you fix the problem. Should you have any recommendations, please use the comments section below.
[wl_navigator]
More about the topics:certificate error
Vlad Turiceanu
Windows Editor
Passionate about technology,Windows, and everything that has a power button, he spent most of his time developing new skills and learning more about the tech world.
Coming from a solid background in PC building and software development, with a complete expertise in touch-based devices, he is constantly keeping an eye out for the latest and greatest!
User forum
0 messages
Sort by:LatestOldestMost Votes
Comment*
Name*
Email*
Commenting as.Not you?
Save information for future comments
Comment
Δ
Vlad Turiceanu
Windows Editor
Coming from a solid background in PC building and software development, he’s a Windows 11 Privacy & Security expert.