How to Verify an SSL Certificate Chain
A certificate can look valid in one browser and fail in another because the chain is incomplete. This guide shows how to read, test and repair a chain.
10 min readUpdated Nov 21, 2026By XPASS Editorial Team

You open your website, see the padlock, and everything looks fine. Then a customer writes that their phone shows a security warning, or an API client refuses to connect. In many of these cases the certificate itself is perfectly valid. What is wrong is the chain: the set of certificates that connects your site to an authority the visitor's device trusts. When a link in that chain is missing, expired or in the wrong order, some clients will accept the site and others will reject it.
This guide explains what the chain is, how to inspect it with a browser and with OpenSSL, how to read the output, and how to repair the most common problems. It is written for site owners, freelancers and small teams who install certificates by hand or through a control panel. If you are about to request a new certificate, it also helps to read how to generate a CSR and private key safely first, because the chain you receive depends on the request you make.
What a certificate chain actually is
A browser does not trust your website certificate because of anything written in it. It trusts it because a trusted party vouches for it. That vouching is expressed as a signature, and signatures form a chain.
- Leaf (end-entity) certificate. This is the certificate issued for your domain, for example
www.example.com. It contains your public key, the names it covers, and its validity dates. - Intermediate certificate(s). Certificate authorities (CAs) rarely sign leaf certificates directly with their most precious key. They use intermediate certificates, which are signed by the root and which in turn sign leaf certificates. There can be one or two intermediates.
- Root certificate. This is a self-signed certificate that ships inside the trust store of the operating system, browser or device. The client trusts it because it was placed there in advance, not because the server sent it.
Verification works backwards. The client reads your leaf certificate, finds who issued it, checks the signature using the issuer's public key, and repeats until it reaches a root it already trusts. The format and the rules for this path are defined in RFC 5280. If any step fails, the whole chain fails.
The key practical consequence is this: your server is responsible for sending the leaf and the intermediates. The client supplies the root. If the server forgets the intermediates, a client has no guaranteed way to bridge the gap between the leaf and the root.

Why a broken chain can look fine on your own computer
The most confusing symptom is inconsistency. You test on your laptop and it works, yet someone else sees an error. There are a few reasons for this.
- Intermediate caching. A browser that visited another site using the same intermediate may already have it stored, so it can complete the path even if your server did not send it.
- AIA fetching. Certificates can include an Authority Information Access field with a URL where the issuer certificate can be downloaded. Some browsers follow that URL; many libraries, mobile apps, command-line tools and older devices do not.
- Different trust stores. Browsers, operating systems and programming runtimes do not always carry identical lists of roots, and an older device may lack a newer root.
- Cross-signed paths. Some CAs offer more than one valid path to a root. A server that sends the wrong alternative can work on new devices and fail on old ones, or the reverse.
Because of this, never conclude that a certificate is installed correctly just because it opens in the browser you happen to use. Test with at least one tool that does not fetch missing certificates silently.
Step 1: Inspect the chain in a browser
The browser view is a good first look, and it needs no tools.
- Open your site over HTTPS.
- Click the padlock or the site-information icon next to the address bar and choose the option for certificate details. The wording differs between browsers.
- Find the tab or section that shows the certificate hierarchy. You should see your domain at the bottom and one or more issuers above it, finishing at a root.
- Click each entry in turn and note the Issued to, Issued by and Valid from / to fields.
What to look for:
- Every certificate's "issued by" should match the "issued to" of the certificate above it.
- No certificate in the path should be expired or not yet valid.
- The domain name on the leaf should match the address you typed. A mismatch is a separate problem described in the guide to fixing certificate name mismatches, so if you find one, stop and deal with it there.
Keep in mind the limit of this method: a browser may display a complete hierarchy even though your server only sent the leaf, because it filled the gap from its cache or by following the AIA URL. For that reason the next step matters.
Step 2: Test the chain with OpenSSL
OpenSSL is available on most Linux and macOS systems and can be installed on Windows. The s_client command opens a TLS connection and prints exactly what the server sends, with no helpful gap-filling.
openssl s_client -connect www.example.com:443 -servername www.example.com -showcerts
The -servername option sends Server Name Indication (SNI). Without it, a server hosting several sites may return a default certificate that is not yours, which leads to confusing results.
Read the output in this order:
- The certificate chain section. Lines starting with
0 s:andi:describe the leaf (subject and issuer). Lines starting with1 s:describe the first intermediate, and so on. If you only see0, your server sent only the leaf. - The verify return code near the end.
Verify return code: 0 (ok)means the chain built successfully against the trust store used by OpenSSL. Codes such as20 (unable to get local issuer certificate)or21 (unable to verify the first certificate)usually mean an intermediate is missing. - The protocol and cipher lines. These are not part of the chain, but they confirm the handshake succeeded.
To print the key fields of the leaf in a short form, you can pipe the output:
echo | openssl s_client -connect www.example.com:443 -servername www.example.com 2>/dev/null | openssl x509 -noout -subject -issuer -dates
This shows the subject, the issuer and the start and end dates, which is handy when you want to confirm quickly that the certificate on the live server is the one you just installed.
Step 3: Check the files you are about to install
Often you can catch problems before they reach the server. Providers usually give you several files: your leaf certificate and a bundle or "CA bundle" with intermediates. Control panels, web servers and load balancers expect these in different forms.
- Some panels ask for the certificate, the private key and the CA bundle in three separate boxes.
- Many web servers expect a single "full chain" file where the leaf comes first and the intermediates follow, all in PEM format.
- The private key must match the leaf certificate. You can compare the public key hashes of the two to confirm.
A quick check of a full chain file is to count the certificates inside it:
grep -c "BEGIN CERTIFICATE" fullchain.pem
A result of 2 usually means a leaf plus one intermediate; 3 means a leaf plus two intermediates. Then you can print each one to confirm the order:
openssl crl2pkcs7 -nocrl -certfile fullchain.pem | openssl pkcs7 -print_certs -noout
The first entry should be the leaf, and each following entry should be the issuer of the one before it. If the order is reversed, many servers still send it as given, and some clients will complain.
A worked example
Suppose you manage shop.example.com and a customer reports that their mobile app cannot connect, although the website works for you.
- In the browser you see three entries: the leaf for
shop.example.com, an intermediate named "Example CA R3", and a root. Everything looks right. - You run
openssl s_clientwith-showcertsand see only entry0, the leaf. At the end it saysVerify return code: 21 (unable to verify the first certificate). - This tells you the server sent only the leaf. Your browser completed the path using a cached intermediate, but the mobile app's library cannot.
- You return to the files from your provider and find a bundle containing the intermediate. You build a full chain file with the leaf first and the intermediate second, and install it in the correct field of your server or panel.
- You reload the server and run the same command again. Now the chain section lists
0and1, and the final line saysVerify return code: 0 (ok). - The customer retries and the app connects.
Notice that nothing was wrong with the certificate. The fix was only to send the complete chain.
Common problems and how to fix them
| Symptom | Likely cause | What to do |
|---|---|---|
| Works in desktop browser, fails in app or script | Missing intermediate | Install the full chain with the intermediate(s) after the leaf |
| Error mentions an untrusted issuer on every device | Self-signed certificate or private CA | Replace with a certificate from a public CA, or distribute the private root deliberately |
| Works on new phones, fails on old ones | Newer root missing on old devices, or wrong cross-sign path | Use the alternative chain your provider offers for older clients |
| Chain order is wrong | Files concatenated in reverse | Put the leaf first, then the intermediates in order |
| Old certificate still served after renewal | Server not reloaded, or another virtual host answers | Reload the service and test with SNI using -servername |
| Verification fails only on some days | An intermediate in the path has expired or been replaced | Download the current bundle from your provider and reinstall |
Expiry deserves its own mention. A chain is only as valid as its weakest link, and every certificate in it has dates. If the leaf is the one that ran out, the browser shows a date error that has its own walkthrough in the guide to ERR_CERT_DATE_INVALID. Check the dates of the intermediates as well, because a stale bundle left on the server after a renewal is a frequent cause.
Installing the chain in a control panel
If you manage hosting through a panel, the chain usually lives in a dedicated field. In the Plesk SSL installation guide the panel asks for the certificate, the private key and the CA certificate separately. Paste the leaf into the certificate field and the intermediates into the CA certificate field, then save and test again with OpenSSL. Do not paste the private key into the CA field, and never share it by email or chat. If you are unsure which file is which, open each one in a text editor: the header line says BEGIN CERTIFICATE for certificates and BEGIN PRIVATE KEY or BEGIN RSA PRIVATE KEY for keys.
For other servers the idea is the same. Apache and Nginx accept a combined file or separate directives, and load balancers usually have a field for the certificate bundle. The specific directive names depend on the version and the setup, so check the documentation of your software, then verify the result from the outside with the commands above rather than trusting the configuration alone.
Limits and what to watch for
- A valid chain is not the whole story. A correct chain proves that the certificate was issued by a trusted authority. It does not by itself confirm that the name matches, that the dates are valid or that the site content is safe.
- Tools differ. Online checkers, OpenSSL, browsers and mobile libraries each have their own trust stores and behaviour. If two tools disagree, find out why instead of choosing the one that gives the answer you want.
- Do not send the root as a fix. Adding the root to the bundle rarely helps, because clients ignore a server-supplied root for trust purposes. The effective fix is nearly always the intermediate.
- Plan for renewals. When you renew or reissue, the intermediate may change. Replace the whole bundle, not only the leaf.
- Private keys stay private. Verifying a chain never requires sending your private key to anyone. If a tool or person asks for it, stop.
- Wait for propagation. After installing, a CDN or load balancer in front of your server may take a short while to serve the new certificate, so retest before assuming the change failed.
If you want a refresher on what the padlock means at a higher level, the Cloudflare explainer on HTTPS is a readable companion, and Let's Encrypt describes how its issuance and chain work in plain language.
A short routine you can repeat
Chain checks take only a few minutes once you have a routine. Consider running these steps whenever you install, renew or move a certificate:
- Confirm the certificate name list covers every hostname you serve.
- Confirm the dates of the leaf and the intermediates.
- Build or download the full chain with the leaf first.
- Install it in the correct fields and reload the service.
- Run
openssl s_clientwith-servernameand check for a verify return code of 0. - Open the site on a phone or another network, ideally with a client that does not share your browser cache.
- Write down the expiry date and set a reminder well before it.
Teams that do this once per change rarely see the "works for me" problem again.
Summary
An SSL certificate chain links your site certificate to a root your visitors already trust, through one or more intermediate certificates. Your server must send the leaf and the intermediates; the root comes from the client. Browsers can hide a broken chain by caching or downloading missing pieces, so verify with OpenSSL s_client, read the verify return code, and check the order and dates of every certificate. Most failures come down to a missing intermediate, a wrong order or an outdated bundle, and all of them are fixed by installing the full, current chain and testing again from outside.
When you are ready to set up certificates for your own domains, the SSL certificates page shows the options and what each one includes.
Frequently asked questions
What is an SSL certificate chain?
It is the ordered set of certificates that links your site certificate to a root certificate your browser already trusts. The usual order is the leaf certificate, one or more intermediate certificates, and then the root.
Why does my site work in one browser but fail in another?
Some clients cache or fetch missing intermediate certificates on their own, while others do not. If your server does not send the full intermediate chain, the stricter clients show an error even though the certificate itself is valid.
Should I install the root certificate on my server?
Normally no. The server should send the leaf certificate and the intermediate certificates. The root is already stored in the trust store of the browser or operating system, so sending it only adds bytes.
How do I check a chain from the command line?
Run openssl s_client with the -connect and -servername options and read the certificate depth listing and the verify return code. A return code of 0 (ok) means the chain verified against the local trust store.
References
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Need an SSL certificate?
Pick the certificate type that fits your site and see the price before you check out.
SSL from $14.99
See SSL certificatesKeep reading

SSL Guides
How to Generate a CSR and Private Key Securely
A practical guide to generating a certificate signing request and private key, including key choices, file permissions, name fields and checks before you submit.
10 min read

SSL Guides
How to Fix ERR_CERT_DATE_INVALID
ERR_CERT_DATE_INVALID has two common causes: a wrong clock on the visitor's device, or a certificate that really has expired. Here is how to tell them apart and fix each.
9 min read

SSL Guides
How to Install an SSL Certificate via Plesk
A step-by-step guide to installing an SSL certificate in Plesk, from creating the request or uploading files to assigning the certificate, redirecting HTTP and checking the result.
9 min read