Security4 min read· 3 practice problems

x509: certificate signed by unknown authority — causes and fixes (missing intermediate, private CA, proxy)

Getting x509: certificate signed by unknown authority or unable to get local issuer certificate? It is one of three causes: a missing intermediate, a private CA root the client lacks, or a corporate TLS proxy. Tell them apart with one openssl s_client run and fix it for Go, curl, Python, Node, Java, Docker and containerd.

On this page
  1. Short answer: the client could not chain the certificate to a root CA it trusts
  2. Same problem, different message per runtime
  3. 30-second diagnosis: see the chain the server sends
  4. Cause 1: missing intermediate — fix the server
  5. Cause 2: private CA — add the root where verification happens
  6. Cause 3: corporate proxy TLS inspection
  7. What not to do
  8. The order to work in
  9. Quick diagnostic checklist

Short answer: the client could not chain the certificate to a root CA it trusts

x509: certificate signed by unknown authority does not mean the server certificate is broken. The client could not complete the chain server certificate → intermediate → a root CA in its own trust store, and the cause is almost always one of three:

  1. The server does not send its intermediate certificate — works in the browser, fails in curl or the app
  2. A private CA the client does not know — fails only in containers or CI
  3. A corporate proxy re-signs TLS traffic — fails only on the office network

Same problem, different message per runtime

  • Go (kubectl, docker, helm): x509: certificate signed by unknown authority
  • curl / OpenSSL: unable to get local issuer certificate
  • Python: CERTIFICATE_VERIFY_FAILED · Node.js: unable to verify the first certificate
  • Java: PKIX path building failed · git: server certificate verification failed

30-second diagnosis: see the chain the server sends

openssl s_client -connect api.example.com:443 -servername api.example.com -showcerts </dev/null
Certificate chain
 0 s:CN = api.example.com
   i:C = US, O = Let's Encrypt, CN = R11
---
Verify return code: 21 (unable to verify the first certificate)
  • Only certificate 0 plus code 21 → missing intermediate (cause 1)
  • Code 20 (unable to get local issuer certificate) → the client does not know the issuing root (cause 2)
  • Code 19 (self signed certificate in certificate chain) → private CA; if the issuer is your company, the proxy (cause 3)

Run the same command where it fails (the container, the CI runner) and compare. If it only works on your laptop, the problem is on the client side, not the server.

Cause 1: missing intermediate — fix the server

Browsers cache or fetch the intermediate and pass anyway; curl, Go and Java fail. That is why "the browser padlock looks fine" is a trap. Make the server send the full chain (server certificate, then the intermediate).

# nginx — fullchain.pem, not cert.pem
ssl_certificate /etc/ssl/example/fullchain.pem;
# building it by hand: server certificate first
cat server.crt intermediate.crt > fullchain.pem && nginx -t && systemctl reload nginx

On a Kubernetes Ingress, check that tls.crt in the TLS Secret holds the full chain.

Cause 2: private CA — add the root where verification happens

# Debian / Ubuntu (on Alpine, apk add ca-certificates first)
cp corp-root.crt /usr/local/share/ca-certificates/ && update-ca-certificates
# RHEL / Rocky
cp corp-root.crt /etc/pki/ca-trust/source/anchors/ && update-ca-trust
# runtimes that ignore the system store
export NODE_EXTRA_CA_CERTS=/etc/ssl/corp-root.pem                   # Node.js
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt        # Python requests
keytool -importcert -cacerts -alias corp-root -file corp-root.crt   # Java
git config --global http.sslCAInfo /etc/ssl/corp-root.pem           # git

If docker pull or image pulls on Kubernetes nodes fail, the CA goes on the node's container runtime, not in the pod.

# Docker
/etc/docker/certs.d/registry.example.com:5000/ca.crt
# containerd — /etc/containerd/certs.d/registry.example.com/hosts.toml
[host."https://registry.example.com"]
  ca = "/etc/containerd/certs.d/registry.example.com/ca.crt"

Cause 3: corporate proxy TLS inspection

If the issuer (i:) in the s_client output is your company or a security product, a proxy swapped the certificate. Get the proxy's root certificate from the security team and add it the same way as in cause 2.

What not to do

curl -k, InsecureSkipVerify, verify=False and NODE_TLS_REJECT_UNAUTHORIZED=0 do not fix anything; they turn verification off. Use them only to confirm the cause, never in production settings.

The order to work in

  1. Where it fails, run openssl s_client -showcerts and read the chain and the Verify return code
  2. Only the server certificate (21) → serve the full chain
  3. Unknown issuer (20 or 19) → add the internal root (or the proxy root) to that client or node
  4. Run it again and look for Verify return code: 0 (ok)

Quick diagnostic checklist

  • Run openssl s_client -showcerts where it fails (container, CI runner, office laptop)
  • Only the server certificate in the chain plus Verify return code 21 means a missing intermediate
  • For a missing intermediate, make the server send the full chain (server certificate, then intermediate)
  • Codes 20 or 19 mean the client does not know the issuing root — add the internal CA root
  • Node (NODE_EXTRA_CA_CERTS), Python (REQUESTS_CA_BUNDLE) and Java (keytool) keep separate stores
  • If docker pull or node image pulls fail, the CA goes on the node runtime, not in the pod
  • An issuer named after your company or a security product means proxy TLS inspection — add the proxy root
  • Use -k or InsecureSkipVerify only to confirm the cause, never in production settings

Practice with this guide

Reviewed problems about the same failure. Write the cause, recovery, and prevention yourself, then compare with the model answer.

Read next