Certificate Chain Fixer & Download

A misordered certificate chain is the most common TLS deployment failure: browsers report an incomplete chain, SSL Labs flags it, and some servers refuse to start. Paste the bundle — this fixer reorders it, verifies every link, and hands back the fixed files.

A certificate chain is the ordered list a TLS server sends — leaf certificate first, then the intermediates that signed it, then the root — each certificate signed by the next, so a client can follow the signatures up to a root it trusts. Paste a bundle here and this fixer reads it in your browser — never uploaded — detects a wrong order, a missing intermediate, duplicates, unrelated certificates, expired certificates and signatures that do not verify, then rebuilds the chain in the right order with a 0–100 score before and after. The companion article Certificate chain fix guide explains each check. Also see the SSL Grader, the SSL Certificate Parser, the SSL Checker and the ASN.1/DER Explorer.

Last updated:

1. Fix a certificate bundle

Drop certificate files here, or choose them below

A PEM bundle, or several certificate files. Up to 1 MB — parsed in your browser.

🔒 The fix runs entirely in your browser: the bundle is never uploaded, never stored, and never sent anywhere. A bundle can name internal hostnames — that is exactly why it stays on your machine.

What a certificate chain is

A certificate chain is the list a TLS server sends during the handshake: the server's own leaf certificate first, then the intermediate certificate(s) that signed it, then — optionally — the root. Each certificate names its issuer, and the next certificate in the list must be that issuer: the leaf's issuer is the intermediate, the intermediate's issuer is the root. A client verifies the chain by checking each signature against the next certificate's public key, walking up until it reaches a root already in its trust store.

Certificates arrive as PEM blocks — base64 DER between -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines. A bundle is simply several blocks concatenated in one file, and the order they were concatenated in is the order the server sends them. That is where the trouble starts: a bundle assembled by hand, copied from a wiki, or exported in the wrong order sends the root first or the intermediates shuffled, and clients that expect leaf-first either fail outright or report an incomplete chain.

Three kinds of certificate make up a chain. The leaf (end-entity) certificate is the server's own — it carries the domain name in its subject or SANs and is the only one that is not a CA. An intermediate is a CA certificate that signs leaves (and sometimes other intermediates) but is itself signed by another CA. The root is a self-signed CA certificate at the top; clients trust it because it is pre-installed in their trust store, not because anything signed it.

The fixer reads the bundle the way a client reads it: it parses every certificate, classifies it by its basicConstraints CA flag and whether it is self-signed, links each certificate to its issuer by name, verifies each signature with the issuer's public key, and then rebuilds the list leaf-first. What it deliberately does not do: invent a missing intermediate — a certificate that is not in the bundle cannot be rebuilt from the leaf — or check the live server; the served chain is a different question, answered by the SSL Checker and the SSL Grader.

What this fixer does — and what it does not

It parses the bundle in your browser — every PEM block, every certificate's subject, issuer, serial, validity dates, SANs, key type and signature algorithm — and runs its checks: order against the fixed order, a missing issuer for any link, duplicate certificates by SHA-256 fingerprint, certificates that belong to no chain, expired and not-yet-valid certificates, signatures that do not verify, self-signed leaves, SHA-1 signatures and RSA keys under 2048 bits. Scoring starts at 100; a wrong order deducts 15, a missing intermediate 20, an expired certificate 15, a failed signature 20, a duplicate or unrelated certificate 8, and the smaller warnings 5 each (error deductions capped at 60, warnings at 36, infos at 6). Bands: 90+ Excellent, 70–89 Good, 50–69 Needs work, below 50 Poor. Two scores are shown: the bundle as pasted, and the fixed chain.

It does not connect to any server, check a trust store, or fetch a missing intermediate: it reads exactly the text you give it. It cannot see the chain your server actually serves — a bundle on disk and the served chain can disagree — nor whether a browser trusts the root, whether the private key matches the leaf (check that with the Certificate Key Matcher), or whether the certificate is revoked. A finding is a pattern, not a verdict — a self-signed root in a bundle for an internal CA is expected, while the same root on a public site is not. Read each finding with its evidence and decide with your context.

The messy demo is a bundle built to trip the checks on purpose — root first, the leaf and its duplicate next, an unrelated certificate in the middle, the intermediate last — and scores 69 (Needs work), with 3 findings. The fixed chain is the same three certificates in leaf → intermediate → root order and scores 100, with every signature verified. The clean demo is the same three certificates already in the right order, and scores 100.

Be honest about what a static fix cannot see

This fixer reads a bundle. It cannot see the chain your server actually serves — the file on disk and the handshake can disagree after a missed reload — nor whether any browser trusts the root, whether the leaf's private key matches (that needs the key, which you should never paste here), or whether a certificate has been revoked. It also cannot see the certificate your CA actually issued if it is not in this bundle: a missing intermediate is reported, never invented.

And a 100 score is not a working TLS deployment. The checks encode widely agreed practice — the TLS specification's certificate_list order, the Mozilla SSL configuration guidance and the CA/Browser Forum baseline requirements — but they are a checklist, not a live test. “No findings” means no problem was found in this text — not that the server behind it serves the chain correctly. Verify the live result with the SSL Checker and the SSL Grader after deploying.

Key facts

Certificate chainThe ordered list a TLS server sends: leaf first, then intermediates, then the root. Each certificate is signed by the next one in the list, so a client can verify the signatures from the leaf up to a root it already trusts.
Leaf certificateThe end-entity certificate: the server's own certificate, carrying the domain name in its subject or SANs. It is the only certificate in the chain that is not a CA certificate, and the only one a server must send first.
Intermediate certificateA CA certificate that signs leaf certificates (and sometimes other intermediates) and is itself signed by another CA. Most chains have one intermediate; some have two or three. A missing intermediate is the most common cause of an incomplete-chain error.
Root certificateA self-signed CA certificate at the top of the chain. Clients trust it because it is pre-installed in their trust store, not because anything signed it. Servers usually do not send the root — clients already have it — but including it in a bundle is harmless.
fullchain.pemThe fixed bundle this tool builds: leaf, intermediates and root in order. It is what nginx wants as ssl_certificate, and what modern Apache wants as SSLCertificateFile. One file, the whole chain, in the right order.
chain.pemThe intermediates only, in order — leaf and root left out. Some servers and load balancers want the intermediates as a separate file, and some ACME clients emit exactly this file alongside cert.pem.
PEMThe text encoding of a certificate: base64 DER between -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines. A bundle is several PEM blocks concatenated; the order of the blocks is the order the server sends the certificates.
Format referenceRFC 5246 §7.4.2 — certificate_list order · Mozilla SSL Configuration Generator · nginx — ssl_certificate (full chain)

Frequently asked questions

Why does the order of certificates in a bundle matter?

Because TLS clients read the chain in the order the server sends it: the first certificate must be the leaf, and each following certificate must be the issuer of the one before it. Send the root first or the intermediates shuffled and strict clients either fail the handshake or report an incomplete chain — even though every certificate in the bundle is valid on its own.

My bundle is missing an intermediate — why can't the fixer just add it?

Because the missing certificate is not in the bundle, and it cannot be rebuilt from the leaf: only the issuing CA holds the private key that signed it. The fixer names the missing issuer so you know what to ask for — fetch it from the CA's download page or from the leaf's AIA (Authority Information Access) URL, add it to the bundle, and run the fixer again.

Should my server send the root certificate?

Usually not. Clients already carry the roots they trust, so sending the root wastes bytes and some strict implementations flag it. Send the leaf plus the intermediates — that is exactly what chain.pem plus leaf.pem is — and keep fullchain.pem (which includes the root) for the servers that want one file with everything in it, like nginx's ssl_certificate.