SECURITY WARNING: Never run commands you don't understand. Always review code before execution. Use at your own risk.
TLS New Added 28 August 2026

TLS: unable to get local issuer certificate

The client built a partial chain and could not reach a trusted root. Either the server omitted its intermediate certificate, or the client's trust store lacks the root. Browsers often hide this by caching intermediates, so curl fails where Chrome succeeds.

Quick fix

Read the commands before running them. Anything that restarts a service, deletes data or changes permissions should be tried on a non-production system first.

Quick fix
# See exactly what the server sends
openssl s_client -connect example.com:443 -servername example.com -showcerts </dev/null

# If only the leaf is shown, the server is missing its intermediate.
# nginx: concatenate leaf + intermediate into one file
cat leaf.crt intermediate.crt > fullchain.crt
# ssl_certificate /etc/nginx/fullchain.crt;

# If the chain is complete, the client trust store is the problem
apt-get install -y ca-certificates && update-ca-certificates

How to diagnose TLS errors

TLS errors have a small number of root causes: the certificate is expired, the hostname does not match any SAN entry, the chain is incomplete (the server did not send its intermediates), the issuing CA is not trusted by this client, or the two sides share no cipher or protocol version. The incomplete-chain case is the most deceptive, because browsers often paper over it with cached intermediates while curl, Java and Go fail.

If the quick fix above does not resolve it, work through these steps. They apply to this whole class of error, not just to this one message, which is usually what saves the time.

  1. Inspect the live handshake: openssl s_client -connect host:443 -servername host -showcerts. It shows the full chain the server actually sends.
  2. Check dates and SANs: openssl x509 -noout -dates -subject -ext subjectAltName. The Common Name is ignored by modern clients: only SANs matter.
  3. If browsers work but curl or your language runtime does not, suspect a missing intermediate. Browsers cache intermediates; other clients do not.
  4. Verify the trust store the failing client uses. Containers frequently ship without ca-certificates installed, and Java, Node and Python each have their own store.
  5. For protocol or cipher errors, check the negotiated version and the server's supported list. TLS 1.0 and 1.1 are disabled by default in current clients.

Tools worth reaching for

  • openssl s_client
  • openssl x509 -noout -text
  • curl -vI
  • testssl.sh
  • sslyze

Authoritative references

Primary documentation for this error, worth reading before applying any fix in production.

curl.se

Related TLS errors

See all 24 TLS errors →

Browse other categories

Something missing or wrong?

This entry is maintained by hand. If the fix is out of date, incomplete, or you have a better one, email a correction and it will be reviewed.