SSL

SSL Certificate Chain Issues: Diagnosis and Repair

An incomplete or badly ordered certificate chain makes your site unreadable for older browsers, breaks API clients and mobile apps, and can fail PCI scans — even when the certificate itself is perfectly valid.

<p>An SSL chain issue means your server is not presenting the full, correctly ordered sequence of certificates linking your own certificate to a trusted root. Browsers usually paper over the gap by downloading missing intermediates (via AIA fetching), but older clients, mobile apps, curl, Java runtimes and payment-terminal SDKs do not — they simply fail with errors like &quot;unable to get local issuer certificate&quot; or &quot;certificate chain incomplete&quot;. Your padlock works for you, but not for everyone.</p> <h2>How the Chain Works</h2> <p>When a certificate authority (CA) issues your certificate, it signs it with an intermediate certificate, which is itself signed by a root stored in the client's trust store. Your server must send: <strong>your certificate + the intermediate(s)</strong>. The root stays client-side — sending it wastes bytes and can even break some parsers. If any intermediate is missing, or the certificates are sent out of order, strict clients cannot build the trust path and reject the connection.</p> <h2>The Symptoms</h2> <ul> <li>Modern desktop browsers show the padlock, but <code>curl</code>, <code>wget</code>, Java, Python <code>requests</code> on some systems, or older Android versions fail</li> <li>Mobile apps or payment integrations report &quot;SSL handshake failed&quot; or &quot;unable to verify the first certificate&quot;</li> <li>PCI DSS or security scanners flag &quot;certificate chain incomplete&quot;</li> <li>Random third-party services (webhooks, monitoring) cannot call your API while your browser tests look fine</li> </ul> <h2>Step 1: Diagnose with OpenSSL</h2> <p>One command shows exactly what your server sends:</p> <pre><code>openssl s_client -connect example.com:443 -servername example.com -showcerts </code></pre> <p>Read the output like a checklist:</p> <ul> <li><code>Verify return code: 0 (ok)</code> — chain validates on this machine</li> <li><code>Verify return code: 21 (unable to verify the first certificate)</code> — you are sending an incomplete chain</li> <li>Count the <code>BEGIN CERTIFICATE</code> blocks — a typical setup sends 2 (leaf + one intermediate); large CAs may need 3</li> </ul> <p>For a friendlier verdict, run a free <a href="https://2mny.com/ssl-check">SSL check</a> — it flags chain completeness, expiry, weak protocols and cipher issues in one report.</p> <h2>Step 2: Rebuild the Full Chain File in the Right Order</h2> <p>CAs ship bundles with names like <code>ca-bundle</code>, <code>intermediate</code>, or a chained <code>.pem</code>. The server's certificate file must contain, in this exact order:</p> <ol> <li>Your domain certificate (leaf)</li> <li>Intermediate(s), from the one that signed your certificate upward</li> </ol> <pre><code>cat example.com.crt intermediate.crt &gt; fullchain.pem </code></pre> <p>For Nginx: <code>ssl_certificate /etc/ssl/fullchain.pem;</code> (one file, chain included). For Apache: <code>SSLCertificateFile /path/example.com.crt</code> + <code>SSLCertificateChainFile /path/intermediate.crt</code> (or since 2.4.8, a single chained file).</p> <p><strong>Never</strong> include the root certificate, and never let the leaf and intermediate swap places — order is part of the protocol, not a style preference.</p> <h2>Step 3: Verify Before and After</h2> <p>After reloading the web server, re-run the diagnosis:</p> <pre><code>openssl s_client -connect example.com:443 -servername example.com &lt;/dev/null 2&gt;/dev/null | openssl verify </code></pre> <p>The verdict you want: <code>example.com: OK</code>. Then test the clients that actually matter to you — a <code>curl https://example.com</code> from a clean machine, your mobile app build, your payment provider's connectivity tool. Browser-only testing hides exactly the population that chain issues hurt.</p> <h2>Step 4: Prevent Regressions</h2> <p>Certificate renewal is where chains break: automation installs the new leaf but drops the intermediates. Two habits prevent that:</p> <ul> <li>Use ACME automation (certbot, acme.sh, Caddy) that always writes a full <code>fullchain</code> file — and alert on its failure</li> <li>Monitor chain completeness and expiry externally (our scanner checks both on every scan — see <a href="https://2mny.com/kb/evidence-verified-findings">how evidence-verified findings work</a>) so a broken renewal page fires an alert instead of waiting for a customer complaint</li> </ul> <h2>Frequently Asked Questions</h2> <h3>Q: Why does my browser show a padlock but curl fails?</h3> <p>A: Modern browsers fetch missing intermediates themselves (AIA fetching) and cache them, so they can display a working HTTPS site even when the server chain is incomplete. Command-line tools, runtimes and embedded SDKs do not have that fallback — they strictly use what the server sends. Fix the server; do not trust the browser's leniency.</p> <h3>Q: Should I include the root certificate in the chain?</h3> <p>A: No. Clients already have roots in their trust stores; sending the root adds bytes and can confuse strict parsers or cause &quot;self-signed certificate in chain&quot; errors in some stacks. Send leaf + intermediates only.</p> <h3>Q: What is a cross-signed intermediate and why does it matter?</h3> <p>A: Some intermediates exist in two versions — one signed by an older root, one by a newer root. Sending the wrong variant for your client population (for example the variant old Androids do not know) breaks old clients. Use the exact bundle your CA recommends for your certificate today.</p> <h3>Q: How often do chain issues appear after renewal?</h3> <p>A: Constantly — it is the single most common post-renewal regression. The new certificate arrives, automation replaces only the leaf file, and the intermediate from the previous CA configuration is gone. Always deploy the CA's current full bundle and verify the chain immediately after every renewal.</p>

Was this article helpful?

Check if your site has this issue

Our free scan covers this and 40 more checks — no signup to start.

Start Free Scan