"Unable to get local issuer certificate": what it means and how to fix it
The client could not build a chain from the server's certificate to a root it trusts. Either the server is not sending its intermediate certificate, or the client's list of trusted roots is missing one. A two-minute check tells you which.
What the error means
When a client connects over TLS, the server sends its own certificate (the leaf) and should send the intermediate certificate that signed it. The client then follows the chain upward until it reaches a root certificate in its local trust store. "Unable to get local issuer certificate" means that walk stopped: for one certificate in the chain, the client could not find the certificate of its issuer, either in what the server sent or in its own store.
The message comes from OpenSSL (verify error 20, X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY), so tools built on OpenSSL or similar libraries all show some form of it:
| Tool | How the error appears |
|---|---|
| curl | curl: (60) SSL certificate problem: unable to get local issuer certificate |
| Git | SSL certificate problem: unable to get local issuer certificate |
| Node.js / npm | UNABLE_TO_GET_ISSUER_CERT_LOCALLY |
| Python (requests, pip, urllib) | CERTIFICATE_VERIFY_FAILED ... unable to get local issuer certificate |
| openssl s_client | Verify return code: 20 (unable to get local issuer certificate) |
The three usual causes
- The server does not send its intermediate certificate. The leaf is signed by an intermediate, not by the root, so without it the client has nothing to link the leaf to a trusted root. Browsers often hide this by fetching or caching the missing intermediate, so the site looks fine in Chrome and fails in curl, scripts and mobile apps.
- The client's trust store is missing or out of date. Old operating systems, minimal container images without the
ca-certificatespackage, and tools that ship their own root list (Python'scertifi, Node.js, Git for Windows) may not include the root the server's chain ends in. - Something in the middle replaces the certificate. Corporate proxies, antivirus HTTPS scanning and some VPNs decrypt traffic and re-sign it with their own root certificate. The operating system may trust that root, but a tool with its own trust store does not.
Find out whether it is the server or the client
Check the same hostname from outside your network with the SSL checker. It lists every certificate the server sends and flags an incomplete chain. If the chain is incomplete there, the fix is on the server. If the chain is complete and trusted there but fails on your machine, the fix is on the client.
From a terminal, look at what the server actually sends:
echo | openssl s_client -connect example.com:443 -servername example.com -showcerts 2>/dev/null | grep -E '^ *[0-9] s:|i:|Verify return code'- Only certificate
0is listed, and its issuer is an intermediate CA: the server is not sending the chain. - The issuer of the top certificate is your company or antivirus vendor, not a public CA: traffic is being intercepted.
- The chain looks complete but verification still fails: the client is missing the root, so update its trust store.
Fix it on the server: install the full chain
Configure the server with the certificate and its intermediates in one file, leaf first. Your CA provides this bundle; with Let's Encrypt and certbot it is fullchain.pem, not cert.pem. Do not add the root itself; clients already have it.
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;On Apache 2.4.8 and later, put the chain in the file named by SSLCertificateFile; the older SSLCertificateChainFile directive is deprecated. On a load balancer or CDN, upload the chain in the separate "certificate chain" field if there is one. Reload the service, then rerun the SSL checker to confirm the chain is complete.
Fix it on the client: trust the right root
First update the system's root certificates. On Debian and Ubuntu, including Docker images based on them, install or update the ca-certificates package; on RHEL, Fedora and similar, update ca-certificates and run update-ca-trust. Python from the python.org macOS installer needs its bundled "Install Certificates.command" run once.
If a proxy or a private CA is involved, get its root certificate in PEM format from your IT team and point each tool at it:
| Tool | Setting |
|---|---|
| curl | --cacert /path/to/ca.pem, or the CURL_CA_BUNDLE environment variable |
| Git | git config --global http.sslCAInfo /path/to/ca.pem; on Windows, git config --global http.sslBackend schannel uses the Windows certificate store |
| Node.js | NODE_EXTRA_CA_CERTS=/path/to/ca.pem adds the root to Node's built-in list |
| npm | npm config set cafile /path/to/ca.pem |
| Python requests | REQUESTS_CA_BUNDLE=/path/to/ca.pem, or upgrade certifi if the root is a public one |
| pip | pip config set global.cert /path/to/ca.pem |
Why you should not turn verification off
Answers online often suggest curl -k, git config http.sslVerify false, NODE_TLS_REJECT_UNAUTHORIZED=0, npm config set strict-ssl false or verify=False in Python. Each one makes the error go away by accepting any certificate at all, including one from an attacker on the network. Use them only for a one-off test, never in a script, CI job or config file that stays.
"Self signed certificate in certificate chain"
This related error (OpenSSL verify error 19, SELF_SIGNED_CERT_IN_CHAIN in Node.js) means the chain was built all the way to a root, but that root is not in the client's trust store. It almost always means a corporate proxy, antivirus product or private CA. The client-side fixes above apply: add that root to the tool's trust store instead of disabling verification.
Frequently asked questions
How do I fix "unable to get local issuer certificate"?
Check the hostname with an SSL checker first. If the chain is incomplete, install the full chain (leaf plus intermediates) on the server. If the chain is fine, update the client's root certificates or point the tool at your proxy's or private CA's root certificate.
What does the error "Unable to get local issuer certificate" mean?
The client could not find the certificate of the authority that issued one of the certificates in the server's chain, either among the certificates the server sent or in its own store of trusted roots, so it cannot verify who it is talking to.
Why does the site work in my browser but fail in curl or Git?
Browsers fill in a missing intermediate certificate on their own and use the operating system's trust store. curl, Git, Node.js and Python often use their own root lists and never fetch missing intermediates, so they expose a chain problem the browser hides.
Is it safe to disable SSL verification to get past the error?
No. Turning verification off accepts any certificate, so anyone between you and the server can read or change the traffic. Fix the chain or add the correct root certificate instead, and keep any verification bypass to a single manual test.
How do I fix error 526?
Error 526 comes from Cloudflare when Full (strict) mode cannot validate your origin server's certificate. Install a valid certificate with its full chain on the origin, or a Cloudflare Origin CA certificate, and check it covers the hostname and has not expired.
What is an intermediate certificate?
A certificate authority's certificate that sits between its root and your site's certificate. Roots sign intermediates, and intermediates sign site certificates. Servers must send the intermediate along with their own certificate, because clients only store the roots.