---
title: "Unable to get local issuer certificate: server chain or client trust? | Proofline"
description: "\"Unable to get local issuer certificate\" means your client found no issuer for a certificate, in what the server sent or in its own trust store."
url: https://proofline.sh/learn/tls-unable-to-get-local-issuer/
---

[Learning center](/learn/)

# Unable to get local issuer certificate: server chain or client trust?

"Unable to get local issuer certificate" means your client found no issuer for a certificate, in what the server sent or in its own trust store. Count the certificates the server sends. If it sends only the leaf, the server's chain is incomplete; if it sends a complete chain and the client still fails, the client's trust store lacks the root.

Network outages The Proofline team November 23, 2026 5 min read

## Two causes behind one message

OpenSSL returns `X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY` with the text `unable to get local issuer certificate` when the issuer of an untrusted certificate cannot be found. A close relative, `unable to verify the first certificate` (`X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE`), appears when the chain holds only one certificate that is not self-signed. curl prints these after `SSL certificate problem:`, Node.js reports the codes `UNABLE_TO_GET_ISSUER_CERT_LOCALLY` and `UNABLE_TO_VERIFY_LEAF_SIGNATURE`, and Go reports `x509: certificate signed by unknown authority`. [OpenSSL verify error codes](https://docs.openssl.org/3.0/man3/X509_STORE_CTX_get_error/) · [curl OpenSSL backend](https://github.com/curl/curl/blob/master/lib/vtls/openssl.c) · [Node.js TLS error codes](https://nodejs.org/api/tls.html) · [Go x509 verify](https://go.dev/src/crypto/x509/verify.go)

Two different faults produce it:

-   **The server omits the intermediate.** The dependency serves its leaf without the intermediate CA that signed it. Your client has the root, but no certificate connects the leaf to it.
-   **The client lacks the root.** The server sends a complete chain, but the root it ends at is not in your client's store. This is common with a private or corporate CA, a new public root an old store has not added, or a client pointed at a custom CA file that replaces the default store.

## Why browsers work and your client does not

A certificate can carry an Authority Information Access extension whose `caIssuers` entry points to a URL for the issuing CA's certificate. RFC 5280 describes it as an aid to building a path to a trusted point. Chromium's certificate verifier has an issuer source that retrieves issuers from these AIA URLs, so a browser can repair a chain the server left incomplete. OpenSSL's path building uses the certificates the server sent and its trust store, and the OpenSSL verification documentation describes no AIA fetch. So curl, Python, Node.js and most service clients fail on a chain that a browser accepts. [RFC 5280 Authority Information Access](https://www.rfc-editor.org/rfc/rfc5280#section-4.2.2.1) · [Chromium AIA issuer source](https://chromium.googlesource.com/chromium/src/+/main/net/cert/internal/cert_issuer_source_aia.h) · [OpenSSL path building](https://docs.openssl.org/3.0/man1/openssl-verification-options/)

"It works in the browser" therefore does not clear the server. Check what the server sends.

## Count what the server sends

From the failing host or container, print the certificates the server sends, in the order it sends them. `-showcerts` shows that list; it is not a verified chain. [openssl s\_client](https://docs.openssl.org/3.0/man1/openssl-s_client/)

```
openssl s_client -connect payments.example.com:443 -servername payments.example.com \
  -showcerts </dev/null 2>/dev/null \
  | awk '/BEGIN CERTIFICATE/{n++; p=1} p{print > ("chain-" n ".pem")} /END CERTIFICATE/{p=0}'

for f in chain-*.pem; do
  echo "== $f"
  openssl x509 -in "$f" -noout -subject -issuer
done
```

Run it in a scratch directory, since awk writes the files there. Read the subject and issuer of each certificate. In a complete chain, each issuer is the next subject, and the last certificate's issuer is a root you expect to trust.

Next, find the AIA URL in the leaf and the store your OpenSSL uses by default. `openssl version -d` prints the OPENSSLDIR setting; the default file and directory sit under it unless `SSL_CERT_FILE` or `SSL_CERT_DIR` override them. [openssl x509 -ext](https://docs.openssl.org/3.0/man1/openssl-x509/) · [openssl version](https://docs.openssl.org/3.0/man1/openssl-version/) · [OpenSSL environment variables](https://docs.openssl.org/3.0/man7/openssl-env/)

```
openssl x509 -in chain-1.pem -noout -ext authorityInfoAccess
openssl version -d
env | grep -E '^SSL_CERT_(FILE|DIR)='
```

Then verify the leaf against an explicit store, with the sent intermediates as untrusted helpers. This reads files only. [openssl verify](https://docs.openssl.org/3.0/man1/openssl-verify/)

```
cat chain-[2-9].pem > sent-intermediates.pem 2>/dev/null
openssl verify -show_chain -CAfile /etc/ssl/certs/ca-certificates.crt \
  -untrusted sent-intermediates.pem chain-1.pem
```

The path `/etc/ssl/certs/ca-certificates.crt` is the Debian and Ubuntu bundle; other distributions use other paths. If the server sent only the leaf, `sent-intermediates.pem` is empty and the verify fails for that reason.

## Read the result

| Server sends | Last issuer in your store? | Points to |
| --- | --- | --- |
| Leaf only | n/a | Server omits the intermediate |
| Leaf plus intermediates | Yes, yet the service fails | Service uses another store |
| Leaf plus intermediates | No | Client store lacks the root |
| Leaf plus intermediates | Root is private | Private CA not installed |

If s\_client on the host verifies but the service in its container fails, the container has another store: [container image CA bundle](/learn/container-image-ca-bundle-missing/). Node.js can use a bundled snapshot of the Mozilla store, chosen at build time, instead of the system store; `--use-openssl-ca` and `--use-system-ca` switch to the system's, and `NODE_EXTRA_CA_CERTS` adds certificates. Java uses its own `cacerts` truststore unless `javax.net.ssl.trustStore` names another. [Node.js CA store options](https://nodejs.org/api/cli.html) · [JSSE default truststore](https://docs.oracle.com/en/java/javase/21/security/java-secure-socket-extension-jsse-reference-guide.html)

## A worked example with two outcomes

This example is illustrative. After a certificate renewal on `payments.example.com`, `checkout` logs `unable to get local issuer certificate`. Engineers open the payments page in a browser and it loads.

In the first outcome, the chain printout has one file, `chain-1.pem`, issued by Example Issuing CA 3. Its AIA extension names `http://ca.example.com/issuing-ca-3.cer`. The renewal installed the new leaf without the new intermediate. Browsers fetched the intermediate from the AIA URL; `checkout` did not. The payments team adds the intermediate to the served chain, and nothing changes in `checkout`.

In the second outcome, the server sends the leaf and Example Issuing CA 3, whose issuer is Example Internal Root 2. That root was distributed to laptops by device management, which is why the browser works. `checkout`'s image trusts only public roots. `openssl verify` against the image's bundle fails; against a file holding Example Internal Root 2 it succeeds. The fix belongs in the `checkout` image or its configuration.

## Limits

`openssl verify` uses your OpenSSL build and the file you name. A service that pins its own CA file, uses a language runtime's bundle or runs a different library can still fail where this passes. Read the service's TLS configuration for a CA file setting before concluding.

Different servers behind one name can send different chains during a rollout. Repeat the printout several times, or against each address the name resolves to. A chain that contains an expired certificate fails with another message: [which certificate expired](/learn/tls-certificate-expired-dependency/). For the other layers a dependency call can fail at, see the [hub for runtime dependency failures](/learn/runtime-dependency-failures/).

## Questions

### Should the server send the root certificate too?

It does not need to. RFC 8446 allows a certificate that specifies a trust anchor to be left out of the chain, since clients must already have it. The server must send the intermediates. [RFC 8446 Certificate message](https://www.rfc-editor.org/rfc/rfc8446#section-4.4.2)

### Why does Go say "signed by unknown authority" instead?

Go's verifier uses its own message for the same condition: it could not build a path from the leaf to a root in its pool. On Linux, Go reads the system bundle from a list of known paths, and `SSL_CERT_FILE` and `SSL_CERT_DIR` override them. [Go x509 root paths](https://go.dev/src/crypto/x509/root_linux.go) · [Go SystemCertPool](https://pkg.go.dev/crypto/x509)

### Is turning off verification a reasonable test?

It proves only that the failure is in verification, which the message already told you. Use `openssl verify` with an explicit CA file instead: it tells you which certificate is missing without changing the service.

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [TLS works on the host but fails inside the container](/learn/container-image-ca-bundle-missing/)
    
    Network outages The Proofline team November 23, 2026 5 min read
    
-   ### [Which certificate expired when a dependency call fails?](/learn/tls-certificate-expired-dependency/)
    
    Network outages The Proofline team November 23, 2026 6 min read
