Every time you visit a website over HTTPS, a sophisticated cryptographic exchange happens in milliseconds — certificates are checked, signatures verified, and a shared encrypted session established before a single byte of your request is sent. This post unpacks exactly what happens, step by step, and then extends it to mutual TLS (mTLS), where both sides of the connection prove who they are.
We will use DigiCert — one of the world's largest certificate authorities — as our real-world example throughout.
What Is a Digital Certificate?
A digital certificate is a signed document that binds a public key to an identity. Think of it as a cryptographic passport. It does not just contain a key — it attaches that key to a name, an organisation, and a validity window, all stamped by a trusted authority called a Certificate Authority (CA).
A typical certificate contains:
- Subject — the entity it was issued to (e.g. login.example.com)
- Issuer — the CA that signed it (e.g. DigiCert TLS RSA SHA256 2020 CA1)
- Public key — the cryptographic key belonging to the subject
- Validity dates — Not Before / Not After
- Extended Key Usage (EKU) — what the cert can be used for (server auth, client auth, etc.)
- CA's digital signature — proves DigiCert vouched for all of the above
The certificate is not secret — it is sent to everyone who connects. Its power comes entirely from the CA's signature at the end.
Public Key vs Certificate — Are They the Same Thing?
This is a common point of confusion. They are different things, but closely related: the certificate contains the public key, plus a great deal more.
A public key alone is identity-less. It is just a number. Anyone could generate one and claim it belongs to google.com. The certificate is what binds that key to an identity — and the CA's signature is what makes that binding trustworthy.
The analogy:
- Public key = your fingerprint. Unique, but tells nobody who you are.
- Certificate = your passport. Fingerprint + name + issuing authority + expiry + government stamp.
- CA's signature = the government stamp. Without it, the passport is worthless.
- Private key = the secret only you know, which proves the passport is genuinely yours.
Figure 1 — Anatomy of an X.509 certificate. The public key is one field among many.
Normal HTTPS — One-Way TLS
In normal HTTPS, only the server proves its identity. The client (your browser) never presents a certificate. The server sends its certificate, the browser validates it, and a shared encrypted session is established.
The Four Validation Checks
When your browser receives the server's certificate, it performs exactly four checks in order:
| Check | What it verifies | How |
|---|---|---|
| 1. Chain of Trust | Is the certificate signed by a trusted CA? | Walks up the chain until it finds a root CA in the browser's built-in trust store |
| 2. Expiry | Is the certificate currently valid? | Checks Not Before and Not After dates against today |
| 3. Hostname Match | Does the cert belong to this domain? | Matches the URL against the CN or Subject Alternative Names (SAN) in the cert |
| 4. Revocation | Has the cert been revoked by the CA? | Queries the CA via CRL (Certificate Revocation List) or OCSP (real-time check) |
The chain of trust check is the most important. The browser does not trust the server's certificate directly — it trusts the root CA (e.g. DigiCert's root), which is pre-installed in the browser. The chain looks like this:
login.example.com cert → signed by DigiCert Intermediate CA → signed by DigiCert Root CA → found in browser trust store ✓
Any tiny tampering with the certificate (changing the domain, swapping the public key, altering the expiry) produces a different hash, and the signature check fails immediately.
What Does a Digital Signature Actually Sign?
This is where most explanations become vague. There are actually two distinct signatures in every TLS connection, and it is important to understand both.
Signature 1 — The CA Signs the Certificate (once, at issuance)
When DigiCert issues a certificate to login.example.com, it does not just sign the public key. It takes a SHA-256 hash of the entire certificate contents — subject, issuer, validity dates, EKU flags, serial number, and the public key all together — and then signs that hash using DigiCert's own private key.
The client verifies this by:
- Extracting DigiCert's public key from the browser trust store
- Decrypting the signature to recover the original hash
- Independently hashing the certificate contents it received
- Comparing the two hashes — if they match, the certificate is genuine and untampered
Signature 2 — The Server Signs the Live Handshake
Just having the certificate is not enough. Anyone could copy a real certificate. So the client challenges the server to sign the live handshake transcript with its private key. Only the genuine server — the one holding the matching private key — can produce a valid signature.
The server takes the full handshake transcript so far (ClientHello + ServerHello + both certificates + all prior messages), hashes it, signs the hash with its private key, and sends the result back as a CertificateVerify message. The client then verifies this signature using the public key extracted from the certificate it just validated.
This is the critical step that defeats impersonation. Even if an attacker copies a real certificate, they cannot sign the handshake challenge without the private key — which never leaves the legitimate server.
Why both signatures are necessary: Signature 1 proves the certificate is legitimate. Signature 2 proves the server actually owns the private key that matches the public key inside that certificate.
Mutual TLS (mTLS) — Both Sides Authenticate
In mTLS, the same mechanism runs in reverse for the client. The server demands a certificate from the client during the handshake, validates it against its own truststore, and challenges the client to prove private key ownership — identical to what the client does with the server, just in the opposite direction.
Figure 2 — Full mTLS handshake. Dashed arrows are the additional steps beyond normal HTTPS.
The Symmetric Picture
Everything that happens on the server side has an exact mirror on the client side in mTLS:
| Aspect | Server Side (both HTTPS and mTLS) | Client Side (mTLS only) |
|---|---|---|
| Certificate issued by | Public CA (e.g. DigiCert) | Dedicated Client Auth CA |
| EKU in certificate | id-kp-serverAuth | id-kp-clientAuth |
| CA signature verified using | Browser / OS trust store | Server's own truststore |
| Live handshake signed by | Server's private key | Client's private key |
| Signature verified using | Server's public key (from cert) | Client's public key (from cert) |
| What it proves | "This is the real server" | "This is the real client" |
DigiCert — A Real-World Certificate Authority
DigiCert is one of the world's largest commercial CAs, trusted by default in all major browsers, operating systems, and application servers. It provides a good illustration of how the CA role works in practice.
What DigiCert actually does
Before issuing a certificate, DigiCert verifies the applicant's identity. There are three levels of verification:
- Domain Validation (DV) — Proves you control the domain, by having you place a specific DNS record or a file on the web server. Fast — typically minutes to hours. Used for most standard HTTPS websites.
- Organisation Validation (OV) — Verifies the legal organisation behind the domain. DigiCert checks business registration documents and may make phone contact. Takes a few days.
- Extended Validation (EV) — The most rigorous level. DigiCert audits legal existence, physical address, and operational status. Used by banks and high-security sites.
The root key is kept offline
DigiCert's root CA private key is stored offline in Hardware Security Modules (HSMs) — physical devices in secured data centres that never connect to the internet. Day-to-day certificate signing is done by intermediate CAs that chain up to the root. If an intermediate is compromised, DigiCert can revoke just that intermediate without touching the root.
Separate hierarchies for server vs client auth
DigiCert maintains separate root hierarchies for different purposes:
- The DigiCert TLS RSA SHA256 intermediate — issues server authentication certificates (for websites)
- The DigiCert Assured ID Root G2 / G3 — dedicated client authentication roots, used for mTLS client certificates
This separation means a problem in the client auth hierarchy cannot affect the trust of public websites, and vice versa. Each hierarchy is purpose-built and independently audited.
How to Tell if a Server Requires mTLS
The simplest test is to try connecting without a client certificate. If the connection succeeds, it is plain HTTPS. If the TLS handshake fails or returns an HTTP 400 error, the server is requiring a client certificate.
Using curl
Run the following from a terminal:
curl -v https://yourserver.com/api
Plain HTTPS — the handshake completes and you get a normal response.
mTLS required — you will see an error such as:
SSL_ERROR_HANDSHAKE_FAILURE_ALERT HTTP/1.1 400 No required SSL certificate was sent
Using OpenSSL
This method is more revealing — it shows exactly which CAs the server trusts for client certificates:
openssl s_client -connect yourserver.com:443
Look for the following in the output:
Plain HTTPS:
No client certificate CA names sent
mTLS server:
Acceptable client certificate CA names /C=US/O=DigiCert Inc/CN=DigiCert Assured ID Root G2 /C=BE/O=GlobalSign nv-sa/CN=GlobalSign Client Authentication Root R45
The "Acceptable client certificate CA names" section is the server explicitly listing which CAs it trusts for client certificates. In plain HTTPS this section is simply absent.
Summary
The entire system of HTTPS and mTLS rests on three interlocking ideas: asymmetric cryptography (public/private key pairs), digital signatures (hash and sign with a private key), and certificate authorities (trusted third parties that bind keys to identities). Remove any one of these and the model collapses.
| Property | Normal HTTPS | Mutual TLS (mTLS) |
|---|---|---|
| Who presents a certificate? | Server only | Both server and client |
| Who validates? | Client (browser) | Both sides validate each other |
| Trust store used for client cert | Not applicable | Server's own configured truststore |
| Who signs the live handshake? | Server only | Both server and client |
| Client certificate required? | No | Yes |
| Typical use case | All public websites | API-to-API, machine identity, zero-trust networks |
mTLS does not replace HTTPS — it extends it. The server still proves its identity exactly as before. mTLS simply adds the mirror requirement: the client must also prove its identity, using the same cryptographic mechanism, in the opposite direction.
