How does an SSL certificate chain bundle work?
Categories:
Understanding the SSL Certificate Chain Bundle

Explore how SSL/TLS certificate chains work, their components (root, intermediate, end-entity certificates), and why they are crucial for establishing trust in secure communication.
When you visit a secure website (HTTPS), your browser needs to verify that the website's identity is legitimate and that your connection is encrypted. This verification process relies heavily on SSL/TLS certificates, which are not just single files but often a 'chain' of certificates. This article will demystify the SSL certificate chain bundle, explaining its structure, purpose, and how it ensures trust in online interactions.
What is an SSL Certificate Chain?
An SSL/TLS certificate chain, also known as a chain of trust, is a hierarchical list of certificates that allows a recipient to verify that the sender's certificate is valid. It links your website's end-entity certificate back to a trusted Root Certificate Authority (CA). This chain is essential because browsers and operating systems typically only trust a limited number of pre-installed root certificates. Intermediate certificates act as a bridge, signing your server's certificate and being signed by a root CA, thereby extending the chain of trust.
flowchart TD A["Root CA Certificate"] --> B["Intermediate CA Certificate(s)"] B --> C["End-Entity (Server) Certificate"] style A fill:#f9f,stroke:#333,stroke-width:2px style B fill:#bbf,stroke:#333,stroke-width:2px style C fill:#ccf,stroke:#333,stroke-width:2px
Simplified SSL Certificate Chain of Trust
Components of the Certificate Chain
A typical SSL certificate chain consists of three main types of certificates, each playing a vital role in establishing trust:
Root Certificate: This is the foundation of trust. Issued by a highly trusted Certificate Authority (CA), it is self-signed and embedded directly into web browsers and operating systems. Root certificates are kept offline and are used to sign intermediate certificates.
Intermediate Certificate(s): These certificates act as intermediaries between the root CA and the end-entity certificate. CAs use intermediate certificates to sign server certificates, rather than directly using their highly secure root certificate. This practice enhances security by keeping the root certificate isolated and protected. There can be one or more intermediate certificates in a chain.
End-Entity (Server) Certificate: This is the certificate issued specifically for your domain (e.g.,
www.example.com
). It is signed by an intermediate CA and presented by your web server to clients (browsers) during the SSL/TLS handshake. This certificate contains your public key and identifies your website.
How the Chain of Trust Works During TLS Handshake
When a client (like a web browser) attempts to establish a secure connection with a server, the following steps related to the certificate chain occur:
- Server Presents Certificates: The server sends its end-entity certificate along with all necessary intermediate certificates to the client.
- Client Verification: The client receives these certificates and begins the verification process. It checks the end-entity certificate's validity (expiration date, domain match, revocation status).
- Intermediate Certificate Verification: The client then verifies that the end-entity certificate was signed by the provided intermediate certificate. It then checks the intermediate certificate's validity.
- Root Certificate Lookup: The client continues up the chain, verifying each intermediate certificate until it reaches a root certificate. It then checks if this root certificate is present in its own trusted root store.
- Trust Established: If all certificates in the chain are valid and the root certificate is trusted, the client establishes trust in the server's identity, and the secure connection proceeds.
sequenceDiagram participant Browser participant WebServer Browser->>WebServer: ClientHello (Request secure connection) WebServer->>Browser: ServerHello, Certificate, ServerKeyExchange, ServerHelloDone Note over WebServer,Browser: WebServer sends End-Entity + Intermediate Certs Browser->>Browser: Verify Certificate Chain alt Chain Valid & Root Trusted Browser->>WebServer: ClientKeyExchange, ChangeCipherSpec, Encrypted Handshake Message WebServer->>Browser: ChangeCipherSpec, Encrypted Handshake Message Browser->>WebServer: Encrypted Application Data else Chain Invalid or Root Untrusted Browser->>Browser: Display Security Warning / Error end
TLS Handshake with Certificate Chain Verification
Bundling Certificates: The .crt
or .pem
File
When you receive an SSL certificate from a CA, you often get multiple files. The 'bundle' typically refers to a file that contains your end-entity certificate and all necessary intermediate certificates concatenated together. This bundle is what your web server (e.g., Apache, Nginx) needs to present to clients. The root certificate is usually not included in the bundle as clients are expected to have it pre-installed.
These files are commonly in PEM (Privacy-Enhanced Mail) format, which is a Base64 encoded ASCII file. They usually have .crt
, .pem
, or .cer
extensions and contain -----BEGIN CERTIFICATE-----
and -----END CERTIFICATE-----
markers.
-----BEGIN CERTIFICATE-----
MIIGPDCCBSSgAwIBAgIQDk... (End-Entity Certificate)
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIGPDCCBSSgAwIBAgIQDk... (Intermediate CA Certificate 1)
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIGPDCCBSSgAwIBAgIQDk... (Intermediate CA Certificate 2 - if applicable)
-----END CERTIFICATE-----
Verifying Your Certificate Chain with OpenSSL
You can use the openssl
command-line tool to inspect and verify your certificate chain. This is a crucial step to ensure your server is presenting the correct and complete chain.
openssl s_client -connect yourdomain.com:443 -showcerts < /dev/null
This command will display the entire certificate chain presented by your server, starting with the end-entity certificate and going up to the root. You can then manually verify each certificate in the output.
openssl verify -CAfile ca-bundle.crt server.crt
Here, ca-bundle.crt
would contain your intermediate certificates (and optionally the root), and server.crt
would be your end-entity certificate. This command checks if server.crt
can be successfully verified against the provided bundle.