Use it when some clients fail with "unable to get local issuer certificate" while browsers work.
Certificate Chain
A certificate chain links the server (leaf) certificate through intermediate CAs to a trusted root. Servers must send the leaf and intermediates; the client has the root.
1. openssl s_client -connect <host>:443 -servername <name> -showcerts — how many certs sent?
2. Only the leaf → configure the fullchain file.
3. Order: leaf, then intermediates.
4. Verify: openssl verify -untrusted chain.pem cert.pem.
5. Retest with s_client (Verify return code: 0).
server sends leaf + intermediates → client builds path to a trusted root → validated
For Certificates & TLS → Certificate Chain, continue with the first unproven Topic check: Record exact host, distribution/kernel, boot ID, time window, workload, identity and the authoritative configuration/policy source for Certificate Chain. If that boundary is healthy, advance to the adjacent check: Read back the effective runtime state and precedence rather than assuming an edited file, package state or service status is active. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
openssl s_client -connect host:443 -showcerts </dev/nullVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
leaf → issuer/intermediate(s) → path constraints/key usage → client trust anchor → chain validation → hostname/application checks
Healthy evidence: server presents correct ordered intermediates, client builds to an accepted trust anchor and verification succeeds without fetching unintended paths
Step 2 Verification and output interpretation Verify boundary
Verification chain. leaf → issuer/intermediate(s) → path constraints/key usage → client trust anchor → chain validation → hostname/application checks
Step 3 Specialized verification Verify boundary
Inspect each certificate’s subject, issuer, SAN, validity, key identifier and CA constraints, then use a verifier with the intended trust store and untrusted intermediate set. Test the live endpoint to see what it actually presents. Compare failures from a representative client because path building can differ by platform. Closure requires the real hostname to validate against the intended trust anchors and the service to present a chain that clients can build, not merely that individual files parse.
Step 4 Commands Verify boundary
openssl verify -CAfile root.pem -untrusted intermediate.pem cert.pem
openssl s_client -connect host:443 -showcerts </dev/null
Step 5 Failure modes and next checks Narrow the fault
Suspicious evidence: missing/wrong intermediate, expired intermediate, cross-sign ambiguity, incomplete bundle, client-specific trust difference or chain works locally but not on the real endpoint
Step 6 Special cases and limits Narrow the fault
A self-consistent set of certificate files is not necessarily trusted by a client. The root may be omitted from the server chain and still validate correctly. A browser’s success can be influenced by cached/fetched intermediates that another client lacks. A valid chain does not show the private key matches the leaf or the application serves the intended virtual host. Keep chain construction, trust, hostname and key/service deployment separate.
Step 7 Common mistakes Narrow the fault
- Serving the leaf without the intermediate.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Browsers may fetch missing intermediates; other clients do not. Configure the full chain file (leaf first, then intermediates). Don't include the root.
openssl x509 -in <cert> -noout -subject -issuer -dates -ext subjectAltName— certificate detailsopenssl s_client -connect <host>:443 -servername <name> </dev/null— live chain and verificationopenssl verify -CAfile <ca> -untrusted <chain> <cert>— chain validationtrust list | head / ls /etc/ssl/certs— system trust store
ReferenceImportant terms & boundaries6 sections · depth on demand
What this shows and what it does not
Chain health is confirmed from the intended client trust context with the actual server-presented chain; local file concatenation alone is not endpoint evidence.
In depth
Certificate chains: building and verifying
Clients trust a server certificate only if they can build a chain from it to a trusted root. Usually that goes through one or more intermediate certificates. RFC 5280 calls this a certification path. The openssl-verify(1) manual page documents verifying chains:
-CAfilenames the trusted roots.-untrustedsupplies intermediates that may be used to build the chain, but aren't trusted by themselves.-show_chainprints the chain that was built.- Errors are reported with a depth, where 0 is the leaf certificate and 1 is its issuer.
How servers should send the chain
| Server sends | Result |
|---|---|
| Leaf + intermediate(s) | Correct |
| Leaf only | Browsers may cope (AIA fetching), but many clients fail: curl, Java, mobile apps, mail servers |
| Leaf + intermediate + root | Works, but the root is unnecessary |
| Intermediates in the wrong order | Some clients fail |
Typical configuration
| Server | Setting |
|---|---|
| nginx | ssl_certificate points to a fullchain file (leaf first, then intermediates) |
| Apache 2.4.8+ | SSLCertificateFile with the leaf followed by the intermediates |
| Postfix | smtpd_tls_chain_files with key, leaf and chain |
| HAProxy | One PEM file with key, leaf and intermediates |
Diagnosing chain errors
| Error | Meaning |
|---|---|
| unable to get local issuer certificate | No path to a trusted root: missing intermediate, or unknown CA |
| self-signed certificate in certificate chain | The chain ends at a root the client doesn't trust |
| certificate has expired | A certificate in the chain (possibly an intermediate) has expired |
| invalid CA certificate | A certificate in the issuer position isn't a CA |
host$ openssl verify -show_chain -untrusted chain.pem www.crt
www.crt: OK
Chain:
depth=0: CN = www.example.net (untrusted)
depth=1: C = US, O = Let's Encrypt, CN = R11 (untrusted)
depth=2: C = US, O = Internet Security Research Group, CN = ISRG Root X1
host$ openssl verify www.crt
CN = www.example.net
error 20 at 0 depth lookup: unable to get local issuer certificate
host$ openssl s_client -connect www.example.net:443 -servername www.example.net -showcerts </dev/null 2>/dev/null | grep -E "^ [0-9] s:| i:"
0 s:CN = www.example.net
i:C = US, O = Let's Encrypt, CN = R11
1 s:C = US, O = Let's Encrypt, CN = R11
i:C = US, O = Internet Security Research Group, CN = ISRG Root X1
host$ cat www.crt chain.pem > fullchain.pem
Reading the example
Verifying the leaf alone fails with "unable to get local issuer certificate", because the intermediate R11 isn't available. With the intermediate supplied as untrusted, the chain builds to the trusted ISRG root. The live server sends the leaf and the intermediate, as it should.
Documented example, not captured output.
How it works at runtime
Certificate Chain is part of Certificates & TLS → Certificate Chain. Certificate Chain covers how a leaf certificate is linked through intermediates to a trust anchor, including server-sent intermediates, path building and alternate chains.
Topic-specific state model. Certificate Chain covers how a leaf certificate is linked through intermediates to a trust anchor, including server-sent intermediates, path building and alternate chains.
Interpretation rule. - Leaf signed by a trusted CA family ≠ client can build a valid chain if intermediates are missing/wrong.
- Server sending the root certificate ≠ necessary or sufficient for client trust.
Specialized mechanics
A certificate chain links the leaf certificate through one or more intermediates to a trust anchor selected by the verifier. Servers normally present the leaf plus required intermediates; clients generally already possess trust anchors and build/validate a path according to signature, constraints, validity, policy and hostname rules. “Chain order” and “trust” are related but different: presentation supplies candidate intermediates while the client’s trust store decides which root is trusted.
Quick reference
A server must send its leaf certificate plus intermediate(s); clients add the root from their trust store.
openssl s_client -connect web01:443 -servername web01.example.com -showcerts </dev/null | grep -E 's:|i:'
openssl verify -untrusted intermediate.pem -CAfile root.pem leaf.pem
cat leaf.pem intermediate.pem > fullchain.pem # nginx ssl_certificate
Symptoms of a missing intermediate: browsers may still work (cached/fetched intermediates) while curl, Java and mobile apps fail with "unable to get local issuer certificate". Order matters: leaf first, then intermediates up towards the root.
Limits and how it fails
Primary failure point. Chain health is confirmed from the intended client trust context with the actual server-presented chain; local file concatenation alone is not endpoint evidence.
ReferenceConfiguration & state2 sections · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. Certificate Chain owns path building between leaf and trust anchor.
Specialized lifecycle
Deploy the correct leaf certificate with the necessary intermediate chain and keep roots out of server bundles unless a specific product requires otherwise. Renewals must update both the certificate files and the running service state. When a CA changes intermediates, confirm cross-signing/path behavior for the client population. Maintain trust stores through platform-supported mechanisms rather than copying ad hoc CA files into application directories unless the application explicitly owns an independent store.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Certificates & TLS → Certificate Chain. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.openssl.org/ · confidence 94%Authoritative Linux project/vendor documentation reviewed for bounded reference claims: certificate path validation, trust store and verification-result boundaries. Documentation-based technical verification only; not lab or production-runtime proof. The schema vendor_doc method is used for authoritative project/vendor documentation; deployment applicability remains separate evidence.
Basis: https://docs.openssl.org/3.6/man1/openssl-verify/ · confidence 93%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Certificate Chain operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Certificate Chain.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Certificate Chain covers how a leaf certificate is linked through intermediates to a trust anchor, including server-sent intermediates, path building and alternate chains. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin host + boot/time + real identity/workload → identify authoritative policy/key/trust source → read back loaded/effective runtime state → reproduce one safe allow/deny/handshake test → correlate audit/service/kernel evidence → locate first failed boundary → make the smallest persistent change → repeat original workload + regression/recovery check. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | leaf → issuer/intermediate(s) → path constraints/key usage → client trust anchor → chain validation → hostname/application checks | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | Chain health is proven from the intended client trust context with the actual server-presented chain; local file concatenation alone is not endpoint proof. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux security/trust evidence can establish this proof path: leaf → issuer/intermediate(s) → path constraints/key usage → client trust anchor → chain validation → hostname/application checks | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove unobserved identities, objects, policies, namespaces, endpoints or time periods. Chain health is proven from the intended client trust context with the actual server-presented chain; local file concatenation alone is not endpoint proof. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven security/trust boundary, capture the adjacent effective state and audit/handshake evidence, make only the demonstrated persistent change, then repeat the original workload plus recovery/regression checks. | Continue to the next unresolved boundary while preserving the original test condition. |
Certificate Chain · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Certificate Chain |
|---|---|
| Topic path | Certificates & TLS → Certificate Chain |
| Runtime state | Certificate Chain covers how a leaf certificate is linked through intermediates to a trust anchor, including server-sent intermediates, path building and alternate chains. |
| Fast checks | - Record exact host, distribution/kernel, boot ID, time window, workload, identity and the authoritative configuration/policy source for Certificate Chain. - Read back the effective runtime state and precedence rather than assuming an edited file, package state or service status is active. - Reproduce one safe allowed/denied or handshake/access test and correlate kernel/service/audit evidence at the first relevant boundary. - Apply the smallest persistent cause-specific change, then repeat the original test plus an adjacent regression/recovery check. |
| Verification chain | leaf → issuer/intermediate(s) → path constraints/key usage → client trust anchor → chain validation → hostname/application checks Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. |
| Failure boundary | Chain health is proven from the intended client trust context with the actual server-presented chain; local file concatenation alone is not endpoint proof. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |
Certificate Chain · specialized operational reference
Topic-specific Linux mechanics, lifecycle, proof path and failure-boundary lookup.
| Operational boundary | Topic-specific reference |
|---|---|
| Presentation | Server: leaf + required intermediates |
| Trust | Client trust anchor/store selects acceptable root |
| Validation | Signatures + constraints + dates + hostname |
| Proof | Representative client builds intended path to trusted anchor |