How to Fix SSL Certificate Chain Errors
fullchain.pem; in Apache add the CA bundle file.How an SSL certificate chain works
Your certificate (the leaf) is signed by an intermediate CA, which is signed by a root in the client's trust store. The server must send the leaf and the intermediates. Roots are already on the client, so sending them is unnecessary.
Symptoms
- Desktop browsers work, but phones, Java apps, curl or API clients fail.
- OpenSSL shows
Verify return code: 21 (unable to verify the first certificate). - An online scan reports "chain incomplete" or "contains anchor".
Desktop browsers sometimes cache or download missing intermediates, which hides the problem until another client breaks.
Diagnose
openssl s_client -connect example.com:443 -servername example.com -showcerts
Count the certificates in the output. You should see the leaf at depth 0 and at least one intermediate. Look at each s: (subject) and i: (issuer) line: each certificate's issuer should be the subject of the next one.
The SSL Checker shows the same chain in readable form. Use the SSL/CSR Decoder to read each individual file.
Fix the SSL certificate chain: build the right file
# order matters: leaf first, then intermediates
cat domain.crt intermediate.crt > fullchain.pem
| Server | Setting |
|---|---|
| Nginx | ssl_certificate points to fullchain.pem |
| Apache 2.4.8+ | SSLCertificateFile can hold the full chain |
| Older Apache | Add SSLCertificateChainFile for the bundle |
| cPanel / Plesk | Fill the CA bundle field |
| HAProxy | Concatenate certificate, chain and key in one PEM file |
Reload the service after saving.
Other causes
- Wrong order in the bundle: intermediate before leaf.
- Wrong intermediate: a CA changed its chain, and you installed an old one. Download the current chain from your CA.
- Cross-signed roots that expired on old devices. Some CAs offer an alternate chain for that case.
- Multiple servers behind a load balancer, one of which has an old file.
Verify
Re-run OpenSSL until it prints Verify return code: 0 (ok). Test from a phone on mobile data too, and with the checker on every IP the name resolves to.
Prevent it next time
Always download the full chain from your CA when you renew, and use the same build script each time so the order stays right. Keep a test that runs OpenSSL against the live host after each deployment and fails when the verify code is not 0. When a CA announces a new intermediate, update your bundle before the old one retires. ACME clients handle this for you, which is one more reason to use them.
Related reading: SSL handshake failures and free SSL on Plesk.
Frequently Asked Questions
Should I include the root certificate in the bundle?
No. Clients have it, and sending it adds bytes without benefit.
Why do some devices fail and others not?
Different trust stores and different handling of missing intermediates.
Does the order of certificates matter?
Yes. Leaf first, then each issuer in sequence.
Is fullchain.pem the same as the CA bundle?
No. fullchain.pem is your certificate followed by the intermediates. The CA bundle holds only the intermediates.
Should I include the root certificate in the bundle?
No. Clients have it, and sending it adds bytes without benefit.
Why do some devices fail and others not?
Different trust stores and different handling of missing intermediates.
Does the order of certificates matter?
Yes. Leaf first, then each issuer in sequence.
Is fullchain.pem the same as the CA bundle?
No. fullchain.pem is your certificate followed by the intermediates. The CA bundle holds only the intermediates.
Why did the chain break after a renewal?
The CA may have issued from a new intermediate. Download the current chain with the certificate instead of reusing the old bundle file.
✅ Post-Installation Verification & SEO Checklist
After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:
- Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
- Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
- Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
- Confirm both root and
wwwversions resolve cleanly to one canonical HTTPS URL. - Verify your HTTPS property and
sitemap.xmlinside Google Search Console and Bing Webmaster Tools.