unable to get local issuer certificate
The tool couldn't find the certificate authority that signed the server's certificate in its own list of trusted authorities, so it refused the connection.
Quick checks
- Are you on a company network or VPN that inspects HTTPS? That's the usual cause.
- Does the same URL work in your browser? Browsers use the macOS keychain; many CLI tools don't.
Fixes on Mac
Get your company's root certificate
- Ask IT for the root CA, or export it from Keychain Access (System Roots or System) as a
.pemfile.
- Ask IT for the root CA, or export it from Keychain Access (System Roots or System) as a
Tell each tool about it
- git:
git config --global http.sslCAInfo /path/to/company-root.pem. - curl:
curl --cacert /path/to/company-root.pem …or setCURL_CA_BUNDLE. - Node.js / npm:
export NODE_EXTRA_CA_CERTS=/path/to/company-root.pem, ornpm config set cafile /path/to/company-root.pem. - Python / pip:
pip config set global.cert /path/to/bundle.pem; python.org installs include Install Certificates.command in the Python folder in Applications, which installs certifi's bundle.
- git:
Update CA bundles
- Homebrew tools use Homebrew's bundle:
brew upgrade ca-certificates. - For Python:
pip install --upgrade certifi.
- Homebrew tools use Homebrew's bundle:
Fixes on Windows
Windows
- Git for Windows can use the Windows store:
git config --global http.sslBackend schannel.
- Git for Windows can use the Windows store:
Other devices
Docker and CI
- Copy the root into the image (
/usr/local/share/ca-certificates/) and runupdate-ca-certificates.
- Copy the root into the image (
Still not working?
Don't fix this with git config http.sslVerify false, npm config set strict-ssl false or NODE_TLS_REJECT_UNAUTHORIZED=0: they turn off the check that protects you from interception. If the server itself is missing its intermediate certificate, browsers may still work (they fetch or cache intermediates) while CLI tools fail; the site's owner should serve the full chain.
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
Why does it work in the browser but not in git or npm?
Browsers on macOS trust the keychain, where IT installs company roots. git, curl, Node and Python often use their own CA bundles that don't include them.
Is it safe to disable SSL verification?
No. It makes the tool accept any certificate, including an attacker's. Add the correct root certificate instead.
What is NODE_EXTRA_CA_CERTS?
An environment variable pointing Node.js to extra trusted certificates in PEM format, added to Node's built-in list. npm and most Node tools respect it.