How to Troubleshoot SSL Certificate Chain Errors
SSL certificate chain errors occur when a browser or client application cannot verify the complete path of trust from your website's end-entity certificate up to a trusted root Certificate Authority. When a visitor hits your site, your server must present not only your SSL certificate, but also the intermediate certificates that bridge the gap to the root store embedded in the client's operating system or browser. If any link in this chain is missing, misordered, or expired, users will encounter security warnings like "NET::ERR_CERT_AUTHORITY_INVALID" or "Your connection is not private."
Diagnosing and resolving these breaks in the trust path requires checking how your web server serves its TLS certificates. By running a quick diagnostic with the SSL Checker, you can instantly inspect your complete certificate chain, spot missing intermediate certificates, verify expiration dates, and ensure your cryptographic setup meets modern security standards. Here is how to systematically find, analyze, and fix SSL chain issues across common server environments.
Understanding the SSL Certificate Chain of Trust
The Public Key Infrastructure (PKI) relies on a hierarchy. At the top are Root CAs, whose self-signed certificates are pre-installed in operating systems, browsers, and mobile devices. Because Root CAs rarely sign end-user certificates directly (for security reasons), they issue Intermediate CAs. These intermediates sign your domain's SSL certificate.
[ Root CA ] (Trusted by browser)
└── [ Intermediate CA ] (Provided by your server)
└── [ Your Domain Certificate ] (Provided by your server)
When a web browser connects to https://example.com, your server sends its SSL certificate and the required intermediate certificates. The browser takes your certificate, verifies it was signed by the intermediate, then verifies the intermediate was signed by the root. If your server fails to send the intermediate certificate, the browser's trust evaluation halts because it cannot bridge your domain to a trusted root.
Step 1: Diagnose the Chain Error
Before changing server configurations, you need to see exactly what your server is presenting to the outside world. Command-line tools and web-based diagnostics can reveal broken chains instantly.
Using OpenSSL to Inspect the Chain
You can query your server directly using the OpenSSL client command. Replace example.com with your actual domain name:
openssl s_client -connect example.com:443 -servername example.com
voices
Examine the output in the Certificate chain section. A healthy server output looks like this:
Certificate chain
0 s:CN = example.com
i:C = US, O = Let's Encrypt, CN = R3
1 s:C = US, O = Let's Encrypt, CN = R3
i:O = Digital Signature Trust Co., CN = DST Root CA X3
If you only see certificate index 0 and no index 1 or higher, your server is failing to serve intermediate certificates.
Using cURL for Quick Verification
You can also use curl to test if the certificate chain validates successfully against the local trust store:
curl -Iv https://example.com
If the chain is broken, you will see an immediate SSL handshake error:
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
* SSL peer certificate verify error: 21 (unable to get local issuer certificate)
Step 2: Fix Missing Intermediates on Your Web Server
Once you confirm the intermediate certificate is missing from your server response, you must download the correct bundle from your Certificate Authority and configure your web server to serve it.
Nginx Configuration
Nginx requires you to combine your primary domain certificate and your intermediate certificate(s) into a single file, often called a fullchain.crt.
- Open your text editor and arrange your certificates in this exact order:
- Your domain certificate (
example.com.crt) - The intermediate certificate(s) (
intermediate.crt)
- Your domain certificate (
- Save the combined file to your server:
-----BEGIN CERTIFICATE-----
[Your Domain Certificate]
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
[Intermediate Certificate]
-----END CERTIFICATE-----
- Update your Nginx configuration file (usually located in
/etc/nginx/sites-available/or/etc/nginx/conf.d/):
server {
listen 443 ssl;
server_name example.com;
ssl_certificate /path/to/fullchain.crt;
ssl_certificate_key /path/to/example.key;
# Modern SSL configuration parameters
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
}
- Test the configuration and reload Nginx:
sudo nginx -t
sudo systemctl reload nginx
Apache Configuration
Apache uses separate directives for the domain certificate, the private key, and the intermediate certificate chain.
- Open your Apache Virtual Host configuration file (often found in
/etc/httpd/conf.d/or/etc/apache2/sites-available/). - Update the SSL directives to explicitly point to your intermediate file:
<VirtualHost 192.0.2.1:443>
ServerName example.com
SSLEngine on
SSLCertificateFile /path/to/example.com.crt
SSLCertificateKeyFile /path/to/example.key
SSLCertificateChainFile /path/to/intermediate.crt
# Note: For Apache 2.4.8 and newer, SSLCertificateChainFile is deprecated.
# Combine your domain cert and intermediate cert into SSLCertificateFile instead.
</VirtualHost>
- Test the syntax and restart Apache:
sudo apachectl configtest
sudo systemctl restart apache2
Windows Server (IIS)
Internet Information Services manages certificates through the Windows Certificate Store, which can occasionally mishandle intermediate certificates if they were not imported into the correct store.
- Open the Microsoft Management Console (MMC) by typing
mmcin the Windows Run prompt. - Add the Certificates snap-in and select Computer account.
- Navigate to Certificates (Local Computer) > Personal > Certificates.
- Right-click your SSL certificate, select All Tasks > Export, and follow the wizard to back up your certificate.
- If your intermediate certificate is missing from the Intermediate Certification Authorities > Certificates folder, right-click the folder, select All Tasks > Import, and import the intermediate bundle provided by your CA.
- Bind the renewed or corrected certificate to your HTTPS site in the IIS Manager bindings panel.
Comparison of Common SSL Errors
| Error Type | Likely Cause | Resolution |
|---|---|---|
| NET::ERR_CERT_AUTHORITY_INVALID | Missing intermediate certificate or untrusted root. | Add the intermediate certificate bundle to your web server config. |
| ERR_CERT_DATE_INVALID | Certificate has expired or system clock is wrong. | Renew the SSL certificate and restart the web server service. |
| ERR_CERT_COMMON_NAME_INVALID | Domain name does not match SAN/CN in cert. | Reissue the certificate with correct domain names or wildcards. |
| SSL Handshake Failure | Incompatible cipher suites or TLS protocol mismatch. | Update ssl_protocols and cipher suite configurations in your server block. |
Common Mistakes and How to Fix Them
Even experienced engineers occasionally trip over subtle configuration mistakes when managing TLS certificates. Avoid these common pitfalls:
- Putting the Root Certificate in the Chain: Some administrators mistakenly append the self-signed root certificate to their intermediate bundle. Root certificates should never be served by your web server; clients already have them locally. Serving roots can bloat the TLS handshake and cause issues on strict clients.
- Reversed Intermediate Order: If your CA provides multiple intermediate certificates (e.g., a cross-sign and a primary intermediate), their ordering matters. The intermediate that signs your domain certificate must come first, followed by any higher-level intermediates.
- Failing to Restart Services: Editing configuration files is not enough. You must explicitly reload or restart your web server daemon (
nginx,apache2,httpd, oriisreset) for the new certificate chain to take effect. - Stale CDN or Load Balancer Caches: If you sit behind a Content Delivery Network (Cloudflare, AWS CloudFront, Fastly) or a reverse proxy (HAProxy, Nginx load balancer), updating the certificate on your origin server will not fix the chain if the edge node is caching an old certificate bundle. Update the certificate inside the CDN dashboard or load balancer as well.
SSL Chain Troubleshooting Checklist
Review this quick list before deploying or updating production certificates:
- Downloaded the exact intermediate bundle corresponding to your specific CA and issuance date.
- Combined domain certificate and intermediate certificates in the correct top-down order.
- Updated web server configuration files (
nginx.conf, httpd virtual hosts, or IIS bindings). - Tested syntax using native server testing tools (
nginx -t,apachectl configtest). - Restarted or reloaded the web server service.
- Verified the complete chain using command-line tools or a web-based SSL verification utility.