Short answer: intermediate SSL certificates link your site’s certificate to a root certificate that browsers already trust. Your server must send your certificate plus the intermediate(s); if one is missing, many clients show “certificate not trusted”. Build the bundle in this order: your certificate first, then the intermediate(s). Leave the root out.
| Certificate | Who holds it | Sent by your server? |
|---|---|---|
| Leaf (server) certificate | You – issued for your domain | Yes, always first |
| Intermediate certificate(s) | The CA – included in your issuance email or download | Yes, after the leaf |
| Root certificate | Browser and OS trust stores | No (usually omitted) |
Is your chain complete?
Enter your domain and see every certificate your server sends, in order.
Test it with the SSL checkerHow the SSL certificate chain works
An SSL certificate chain, also called the chain of trust, is a sequence of certificates where each one is signed by the next. The browser follows the signatures upward until it reaches a root it already trusts. If any link is missing, the trust check fails.
Root CA certificate (stored in the browser/OS trust store)
└── signs → Intermediate CA certificate (sent by your server)
└── signs → Leaf certificate: www.example.com (sent by your server)
What is a root certificate in SSL?
A root certificate is the self-signed certificate at the top of the chain. Operating systems and browsers ship a list of trusted roots, called the root store, and update it through software updates. CAs keep root keys offline and do not sign customer certificates with them directly.
What is an intermediate certificate?
An intermediate certificate is a CA certificate signed by the root, which then signs customer certificates. It lets the CA keep the root offline. You get it from the CA together with your certificate, often as a file named ca-bundle, chain.pem or .p7b.
What is a leaf certificate in SSL?
The leaf, or end-entity certificate, is the one issued for your domain. It cannot sign other certificates. It carries your domain names, your public key and the validity dates.
Should the bundle include the root certificate?
Usually not. Clients already have the root in their trust store, so sending it adds bytes to every handshake without adding trust. Some checkers flag an included root as “contains anchor”, which is a warning, not an error. A chain can also have two intermediates, for example when a CA uses a cross-signed certificate to reach older roots. In that case include every intermediate the CA supplied, in the order given, ending with the one closest to the root.
Why intermediate SSL certificates cause “not trusted” errors
A missing intermediate is the most common reason a freshly installed certificate shows as not trusted. Your server sends only the leaf, and the client cannot connect it to a root.
The error is often inconsistent. Some desktop browsers can fetch a missing intermediate from the address in the certificate’s Authority Information Access (AIA) field, or keep a cache of known intermediates. Many other clients do not: curl, git, Python, Java, payment gateways, APIs and some mobile apps. That is why a site can look fine in your browser and still fail elsewhere.
Tip: Never test a chain only in your own browser. Use the SSL checker or openssl s_client, which show exactly what the server sends.
How to bundle SSL certificates (combine and concatenate)
Collect the files
Your certificate (e.g. example_com.crt) and the CA's intermediate file(s) from the issuance email or your account.
Concatenate in order
Leaf first, then each intermediate, ending with the one closest to the root. Linux/macOS: cat example_com.crt intermediate.crt > fullchain.pem. Windows (cmd): type example_com.crt intermediate.crt > fullchain.pem
Check the joins
Open the file. Each "—–END CERTIFICATE—–" must be on its own line, followed by "—–BEGIN CERTIFICATE—–" on the next line.
Verify
Run openssl verify -untrusted intermediate.crt example_com.crt. "OK" means the chain builds to a trusted root.
How to install an intermediate SSL certificate
Where the bundle goes depends on the server. On Nginx, point ssl_certificate to the full-chain file. On Apache 2.4.8 and later, SSLCertificateFile can hold the leaf plus intermediates. On IIS, intermediates belong in the Intermediate Certification Authorities store, which a .p7b or a PFX with chain fills for you. For full server steps, see how to install an SSL certificate.
After a change, reload the web server and test again. To see the chain your server sends, run:
openssl s_client -connect example.com:443 -servername example.com -showcerts </dev/null
Look at the “Certificate chain” list at the top and “Verify return code” at the end. Code 0 (ok) means the chain is complete.
“SSL certificate problem: unable to get local issuer certificate”
This error means the client could not find the certificate that issued the one it received. Either the server did not send the intermediate, or the client’s own CA bundle lacks the root or a private CA.
First test the server with the SSL checker. If the chain is incomplete, fix it on the server. If the chain is complete, the problem is on the client side:
- Outdated CA bundle: update the OS package (
ca-certificates) or the root store; see clear SSL state and update root certificates. - curl:
curl --cacert /path/to/ca.pem https://example.com - git:
git config --global http.sslCAInfo /path/to/ca.pem - Git for Windows:
git config --global http.sslBackend schanneluses the Windows certificate store. - Node.js / Python: set
NODE_EXTRA_CA_CERTSorREQUESTS_CA_BUNDLEto the CA file.
“Self signed certificate in certificate chain”
This means the chain ends in a root the client does not trust. Common causes are a company proxy or antivirus that inspects HTTPS, or an internal private CA. Add that root to the client’s trust store with the options above. Self-signed and private CAs are explained in self-signed vs CA-signed SSL.
Tip: Do not “fix” these errors with-k,http.sslVerify falseor similar. That turns off protection against impersonation. Why it is risky and when it is acceptable is covered in disabling SSL verification.
Chain errors: cause and fix
| Message | Likely cause | Fix |
|---|---|---|
| Verify return code 21: unable to verify the first certificate | Server sends leaf only | Add intermediate(s) to the server bundle |
| Verify return code 20 / “unable to get local issuer certificate” | Missing intermediate or outdated client CA bundle | Fix server chain; update client CA bundle |
| Verify return code 19 / “self signed certificate in certificate chain” | Untrusted root (proxy, private CA) | Add that root to the client trust store |
| Chain shows wrong intermediate | Old bundle from a previous certificate | Download the bundle that matches the new certificate |
| Key does not match certificate | Files concatenated in the wrong order | Put the leaf first, intermediates after |
After every change, run the SSL checker again to confirm the full chain is served.
Confirm your fix
Check the chain, hostname and expiry your server sends right now.
Run the SSL checker