self signed certificate in certificate chain
The certificate chain ends in a root certificate that isn't in the tool's trusted list. Usually that root belongs to a proxy on your network that re-signs HTTPS traffic.
Quick checks
- Are you behind a company proxy, VPN or antivirus that scans HTTPS?
- Check the issuer: `openssl s_client -connect registry.npmjs.org:443 -servername registry.npmjs.org </dev/null | grep issuer`.
Fixes on Mac
Trust the proxy's root for your tools
- Export the root from Keychain Access as PEM (or get it from IT).
- Node/npm:
export NODE_EXTRA_CA_CERTS=~/certs/company-root.pemin~/.zshrc. - git:
git config --global http.sslCAInfo ~/certs/company-root.pem. - Python: point
REQUESTS_CA_BUNDLEorpip config set global.certat a bundle that includes the root.
For your own self-signed server
- Prefer a real certificate (Let's Encrypt), or a local CA with mkcert for development.
Fixes on Windows
Windows
- Use
NODE_EXTRA_CA_CERTS, andgit config --global http.sslBackend schannelto use the Windows store.
- Use
Other devices
Containers
- Install the root in the image's trust store and rebuild.
Still not working?
Avoid strict-ssl false and NODE_TLS_REJECT_UNAUTHORIZED=0. If the root isn't from your organisation, something unexpected is intercepting your traffic; stop and investigate.
See what’s happening
LightAtom's connections view shows whether your tools connect to a proxy address instead of the server, and which process runs that proxy.
Frequently asked questions
What does “self signed certificate in certificate chain” mean?
The chain the server presented ends in a self-signed root your tool doesn't trust. On company networks that root usually belongs to an HTTPS-inspecting proxy.
How do I fix it for npm?
Set NODE_EXTRA_CA_CERTS to the proxy's root certificate (PEM), or npm config set cafile to a bundle containing it. Don't disable strict-ssl.
How do I make a trusted local HTTPS certificate?
Use mkcert: it creates a local CA, installs it in the macOS keychain and issues certificates for localhost and your dev domains.