opyeb pemcheck

pemcheck · Verification

Chain order — linking leaf, intermediate and root

Verification · 6 min read

The short answer

A TLS chain runs leaf (server certificate) → intermediate CA → root CA. Each certificate's Issuer must equal the next certificate's Subject. Servers send the leaf and intermediates; the root usually lives in the client trust store and is omitted.

Linking starts with names

If the Issuer DN of certificate A equals the Subject DN of certificate B, then B issued A. DER-encoded names are byte-identical for the same name, so comparing bytes is more reliable than pretty-printing strings.

This tool compares each subject and issuer as DER bytes, finds the parent of every certificate, starts from the certificate that is nobody's issuer (the leaf) and walks upward. Comparing that order with the input yields correct / reversed / mixed / gap.

Four common failures

SymptomCauseFix
missing intermediateserver sends only the leafadd the intermediate to the server configuration
reversed orderroot first or wrong file ordersort from the leaf again
server sends the rootunnecessary bytes and confusionkeep the root in the trust store only
cross-signing confusiontwo roots with the same namecheck AKI/SKI and the actual chain

What the chain check does not do

A matching issuer and subject does not mean the signature is valid. Real trust also needs signature verification, key usage, basic constraints, validity and revocation checks. This tool shows order and linkage only, and says so on the page.

In production run the real check, for example openssl verify -CAfile root.pem -untrusted chain.pem leaf.pem, and confirm browsers and mobile clients see the same chain.

Server configuration checklist

Self-signed certificates

When subject and issuer are the same, the certificate is self-signed. This is normal for private CAs and test environments; public services need that root installed in the client trust store. This tool reports a single self-signed certificate as its own state.

Chain order is “who issued whom”; trust is “do I trust that issuer”. Keep the two questions separate.

Questions

Should a server send the root certificate?

Usually not. Clients already hold the root in their trust store, so omitting it is normal and saves bytes. A private CA whose root is not preinstalled must be distributed separately.

Does a wrong order break browsers?

It depends on the browser and TLS library. Some reorder the chain themselves, but a missing intermediate fails. Sending the correct order is safest.

What is a cross-signed certificate?

A certificate for the same subject key signed by a different root, used to support old and new clients at once. The name matches but the signer differs, so check AKI/SKI and the actual chain.

Paste three certificates to see the recommended order and any gap.

Open the checker

This article follows RFC 5280 and the CA/Browser Forum Baseline Requirements.