OpenSSL: error:num=20:unable to get local issuer certificate / SSL: CERTIFICATE_VERIFY_FAILED
The client could not build a chain from the server's certificate to a CA it trusts — the issuer is missing locally or the server did not send the intermediate.
unable to get local issuer certificateverify error:num=20:unable to get local issuer certificateSSL: CERTIFICATE_VERIFY_FAILED unable to get local issuer certificateVerify return code: 20 (unable to get local issuer certificate)x509: unable to get local issuer certificate Meaning
Either the server sends an incomplete chain (fix with fullchain), or the client's CA bundle lacks the root (minimal containers, old systems, corporate roots). openssl s_client -showcerts shows what the server sends; update-ca-certificates or installing ca-certificates fixes the client.
Common causes
- Server omitted intermediate certificates
- Client missing or outdated CA bundle
- Corporate proxy with a private root
- Custom CA not in the trust store
- Wrong
SSL_CERT_FILE/REQUESTS_CA_BUNDLE
⚡ Quick fix
- Server: use the full chain file
- Client:
apt-get install -y ca-certificates && update-ca-certificates - Point tools at a bundle that includes your CA
Detailed fix by platform
Linux
openssl s_client -connect host:443 -servername host -CAfile /etc/ssl/certs/ca-certificates.crt </dev/null | grep -E "Verify return|verify error"
How to diagnose
- Chain — What does the server send?
- Bundle — Client CA store updated?
- Proxy — Interception?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- ca md too weak / ee key too small OpenSSL: error:0A00018E:SSL routines::ca md too weak / error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee key too small
- curl: (60) SSL certificate problem curl: (60) SSL certificate problem: unable to get local issuer certificate
- DEPTH_ZERO_SELF_SIGNED_CERT Node/OpenSSL: Error: self signed certificate (code: DEPTH_ZERO_SELF_SIGNED_CERT)
Most viewed in SSL / TLS
- NET::ERR_CERT_COMMON_NAME_INVALID NET::ERR_CERT_COMMON_NAME_INVALID: Your connection is not private (certificate is for a different domain)
- Challenge failed for domain Let’s Encrypt / Certbot: Challenge failed for domain example.com — Invalid response from http://example.com/.well-known/acme-challenge/x: 404
- Certificate pinning failure! Android/OkHttp: javax.net.ssl.SSLPeerUnverifiedException: Certificate pinning failure! Peer certificate chain: sha256/... Pinned certificates for api.example.com
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 4 Nov 2026