Why certificates exist
A public key is worthless until something proves whose it is
A certificate authority signs a certificate binding a public key to a name, stopping on-path attacks.
Public-key cryptography has a weak spot. When Ben asks bank.com for its public key, an attacker in the middle can swap in their own. Ben encrypts to the attacker, who reads everything and passes it on. Nothing proves whose key it is. A certificate fixes this. A certificate authority checked that the key belongs to bank.com and signed that statement. Ben checks the signature. A swapped key fails.
X.509 certificates
A certificate is a signed card: who, which key, until when
An X.509 certificate holds the subject alternative name list, issuer, validity, public key, serial and signature.
Open any certificate and you find the same fields. Who it is for: the subject, and the list of alternative names. Browsers check the name against this list. Who issued it, and the dates it is valid between. Two hundred days is now the maximum. The server’s public key and what it may be used for, plus a serial number used to revoke it. And the issuer’s signature over all of it. Change one character, and the signature fails.
Certificate types and formats · Going deeper
Wildcards, validation levels and the files certificates come in
Know DV, OV and EV, wildcard certificates, self-signed certificates and PEM, DER and PKCS#12 files.
Know DV, OV and EV, wildcard certificates, self-signed certificates and PEM, DER and PKCS#12 files. Kinds of certificate. Domain validated (DV) the CA checks only control of the domain, through a DNS record or a file on the web server. Most of the web. Organisation and extended validation (OV, EV) the CA also checks the legal organisation. Browsers no longer show EV differently, so its value is mostly in contracts and audits. Wildcard *.example.com covers one level of names: shop.example.com, but not a.shop.example.com or example.com itself. One key across many servers raises the stakes if it leaks. Multi-domain (SAN) one certificate listing several names in its Subject Alternative Name field. Self-signed signed by its own key, so no chain to a trusted root: fine for a lab, never for users. Other uses code signing (software publishers), S/MIME (email), client certificates (devices and users), and private CAs for internal names. File formats. A certificate signing request (CSR) holds the public key and the names, signed with the private key. The private key itself never leaves the server.
Kinds of certificate
- Domain validated (DV) the CA checks only control of the domain, through a DNS record or a file on the web server. Most of the web.
- Organisation and extended validation (OV, EV) the CA also checks the legal organisation. Browsers no longer show EV differently, so its value is mostly in contracts and audits.
- Wildcard *.example.com covers one level of names: shop.example.com, but not a.shop.example.com or example.com itself. One key across many servers raises the stakes if it leaks.
- Multi-domain (SAN) one certificate listing several names in its Subject Alternative Name field.
- Self-signed signed by its own key, so no chain to a trusted root: fine for a lab, never for users.
- Other uses code signing (software publishers), S/MIME (email), client certificates (devices and users), and private CAs for internal names.
File formats
Chain of trust
Your device trusts a few roots; every site borrows that trust
A chain of trust runs from a root CA in the trust store through an intermediate CA to the site.
Why should your browser trust a CA it has never met? Because of a chain. A root CA, kept offline, signs an intermediate. The intermediate signs the site’s certificate. Your operating system and browser ship with a list of trusted roots: the trust store. The server sends its certificate and the intermediate. The browser checks each signature, from the site up to a root it already holds. Only then does it trust the server’s key.
Issuing a certificate · Going deeper · 1 of 4
From key pair to installed certificate, and why roots stay offline
Issuance runs key pair, CSR, domain validation, signing, logging and install, with roots kept in HSMs.
Issuance runs key pair, CSR, domain validation, signing, logging and install, with roots kept in HSMs. The steps. 1 Generate a key pair on the server the private key stays there, ideally in a hardware module or a cloud key service. 2 Create a CSR the public key and requested names, signed with the private key to prove possession. 3 The CA validates for DV, a token placed in DNS or on the web server; for OV and EV, checks on the organisation too. 4 The CA signs and logs it the intermediate signs, and the certificate is submitted to Certificate Transparency logs. 5 Install leaf and intermediate a missing intermediate is a classic cause of “works in one browser, fails in another”. Protecting the top of the chain. Root keys sit in offline hardware security modules, used only in recorded ceremonies with several people present (split knowledge, dual control). Intermediates do the daily work, so a breached intermediate can be revoked without touching the roots inside billions of devices. Private PKI. Companies run their own CA for internal names, VPNs, Wi-Fi (802.1X) and device certificates. Its root must be pushed to company devices through device management; everywhere else it is untrusted.
The steps
- 1 Generate a key pair on the server the private key stays there, ideally in a hardware module or a cloud key service.
- 2 Create a CSR the public key and requested names, signed with the private key to prove possession.
- 3 The CA validates for DV, a token placed in DNS or on the web server; for OV and EV, checks on the organisation too.
- 4 The CA signs and logs it the intermediate signs, and the certificate is submitted to Certificate Transparency logs.
- 5 Install leaf and intermediate a missing intermediate is a classic cause of “works in one browser, fails in another”.
Protecting the top of the chain
Root keys sit in offline hardware security modules, used only in recorded ceremonies with several people present (split knowledge, dual control). Intermediates do the daily work, so a breached intermediate can be revoked without touching the roots inside billions of devices.
Private PKI
Companies run their own CA for internal names, VPNs, Wi-Fi (802.1X) and device certificates. Its root must be pushed to company devices through device management; everywhere else it is untrusted.
Chain of trust · Going deeper · 2 of 4
When a CA was breached, every website became fakeable
The DigiNotar breach (2011) produced at least 531 rogue certificates and ended with the CA distrusted.
The system rests on CAs. In 2011, one fell. In June an attacker broke into the Dutch CA DigiNotar. In July they issued rogue certificates, including one for every Google site. At least five hundred and thirty-one in ten days. From August the Google certificate was used to intercept about three hundred thousand users, nearly all in Iran. On the twenty-ninth, Chrome’s built-in pin for Google’s keys exposed it. Browsers removed DigiNotar’s roots, and within weeks the company was bankrupt.
Chain of trust · Going deeper · 3 of 4
Every certificate is logged in public, so fakes are caught fast
Certificate Transparency logs every public certificate; browsers require SCTs; owners monitor the logs.
The answer to DigiNotar was to put every certificate on the record. Before issuing, a CA submits the certificate to public, append-only logs. The logs return signed receipts, which go into the certificate. Browsers refuse public certificates without them. And because the logs are public, you can watch them. A certificate for your domain from a CA you never use triggers an alert, in hours rather than months.
More ways to use certificates · Going deeper · 4 of 4
Mutual TLS, pinning, HSTS and code signing
Mutual TLS authenticates clients, HSTS forces HTTPS, pinning limits trusted keys, code signing proves software origin.
Mutual TLS authenticates clients, HSTS forces HTTPS, pinning limits trusted keys, code signing proves software origin. Mutual TLS (mTLS) the client presents a certificate too. Used between microservices, for APIs and for device identity in zero trust networks. HSTS a response header telling browsers to use only HTTPS for a domain for a set time; preload lists build it into browsers. Certificate pinning an app accepts only specific keys or CAs for its own servers. Strong, but brittle: a key change can lock users out, so browsers dropped it for websites and it lives mainly in mobile apps. Code signing publishers sign software and updates; the operating system checks the signature before running it. Stolen signing keys are prized by attackers. CAA records a DNS record listing which CAs may issue for a domain; CAs must check it before issuing. Exam tip: for “confirm a server is who it claims”, think certificates and TLS; for “confirm the client too”, think mutual TLS.
- Mutual TLS (mTLS) the client presents a certificate too. Used between microservices, for APIs and for device identity in zero trust networks.
- HSTS a response header telling browsers to use only HTTPS for a domain for a set time; preload lists build it into browsers.
- Certificate pinning an app accepts only specific keys or CAs for its own servers. Strong, but brittle: a key change can lock users out, so browsers dropped it for websites and it lives mainly in mobile apps.
- Code signing publishers sign software and updates; the operating system checks the signature before running it. Stolen signing keys are prized by attackers.
- CAA records a DNS record listing which CAs may issue for a domain; CAs must check it before issuing.
Certificate validation
Five checks stand between you and a fake website
Browsers check the chain, the name, the dates, revocation and Certificate Transparency.
Every time you open a secure site, the browser checks five things. The chain ends at a trusted root. The site name is in the certificate. Today falls within its dates. It has not been revoked. And it was publicly logged. Each failure has its own warning, which is useful when you troubleshoot. The danger is training people to click through them.
Certificate lifetimes
Certificates will last 47 days, so renewal must be automatic
The CA/Browser Forum cut lifetimes to 200 days in 2026, 100 in 2027 and 47 in 2029. ACME automates renewal.
Certificates are getting much shorter lives. Until 2015 they could last five years. Then thirty-nine months, then eight hundred and twenty-five days, then three hundred and ninety-eight. Since March 2026, two hundred days. One hundred days from 2027, and forty-seven days from 2029. And a CA may reuse a domain check for only ten days. Nobody renews that often by hand. Renewal has to be automated, and every certificate tracked.
Automating renewal · Going deeper · 1 of 2
ACME, challenges and keeping an inventory
ACME (RFC 8555) proves domain control with HTTP-01, DNS-01 or TLS-ALPN-01 challenges and renews automatically.
ACME (RFC 8555) proves domain control with HTTP-01, DNS-01 or TLS-ALPN-01 challenges and renews automatically. How ACME works. A client on the server (such as Certbot, or the one built into a load balancer or cloud service) asks the CA for a certificate, proves control of the name, receives the certificate and renews it well before expiry, with no person involved. Let’s Encrypt made this standard; most public CAs now support it. HTTP-01 the CA fetches a token from http://name/.well-known/acme-challenge/. Simple; cannot issue wildcards. DNS-01 the client publishes a TXT record. Works for wildcards and internal servers, but needs DNS credentials, which must be protected. TLS-ALPN-01 the proof is presented in a special TLS handshake on port 443. What teams track. Expired certificates have taken down major services and hidden attacks: an inspection device with an expired certificate stops inspecting traffic.
How ACME works
A client on the server (such as Certbot, or the one built into a load balancer or cloud service) asks the CA for a certificate, proves control of the name, receives the certificate and renews it well before expiry, with no person involved. Let’s Encrypt made this standard; most public CAs now support it.
- HTTP-01 the CA fetches a token from http://name/.well-known/acme-challenge/. Simple; cannot issue wildcards.
- DNS-01 the client publishes a TXT record. Works for wildcards and internal servers, but needs DNS credentials, which must be protected.
- TLS-ALPN-01 the proof is presented in a special TLS handshake on port 443.
What teams track
Certificate lifetimes · Going deeper · 2 of 2
Cancelling a certificate is easy; getting browsers to notice is not
Revocation uses CRLs, OCSP or OCSP stapling; short lifetimes now do much of the work.
What if a server’s private key is stolen? The CA revokes the certificate. The hard part is telling every client. A certificate revocation list is a signed list of revoked serial numbers. It can be big, and hours old. OCSP lets the client ask the CA about one certificate, live. But the CA learns which sites you visit. Let’s Encrypt switched OCSP off in 2025. With stapling, the server fetches the signed answer itself and includes it in the handshake. And short lifetimes mean a bad certificate soon expires anyway.
TLS handshake
TLS 1.3 sets up a secure connection in one round trip
TLS 1.3 exchanges ECDHE key shares in the first two messages and encrypts the rest, including the certificate.
Now watch the certificate in action, in a TLS 1.3 handshake. The browser says hello: the versions and cipher suites it supports, and a Diffie-Hellman key share. The server picks a suite and replies with its own key share. Both sides can now derive the same keys. So everything else is encrypted: the certificate, a signature over the handshake proving the server holds the private key, and a Finished message. The browser checks it all, sends Finished, and the first web request goes straight away. One round trip.
TLS handshake · Going deeper · 1 of 2
Stealing tomorrow’s key cannot unlock yesterday’s traffic
Forward secrecy comes from ephemeral ECDHE keys; TLS 1.3 requires it.
Attackers sometimes record encrypted traffic, hoping to read it later. With old RSA key exchange, the session key travelled encrypted with the server’s long-term key. Steal that key in 2028, and every recording from 2026 opens. With ephemeral Diffie-Hellman, each session uses fresh key shares that are thrown away. The long-term key only signs. Steal it, and there is nothing to decrypt. TLS 1.3 always works this way.
TLS versions and attacks · Going deeper · 2 of 2
Why SSL and early TLS were retired, and what still goes wrong
Only TLS 1.2 and TLS 1.3 are acceptable; downgrade attacks, POODLE and Heartbleed show why.
Only TLS 1.2 and TLS 1.3 are acceptable; downgrade attacks, POODLE and Heartbleed show why. Versions. What still goes wrong. Downgrade attacks an attacker tricks both sides into an older, weaker version. TLS 1.3 signs the negotiation so tampering is detected; servers should disable old versions. Implementation bugs Heartbleed (CVE-2014-0160, 2014) let anyone read up to 64 KB of an OpenSSL server’s memory at a time, including private keys. Stripping HTTPS an attacker keeps the victim on plain HTTP. HSTS tells browsers to use only HTTPS for a site. Interception company proxies decrypt TLS for inspection using their own root installed on devices: useful for defence, and a high-value target.
Versions
What still goes wrong
- Downgrade attacks an attacker tricks both sides into an older, weaker version. TLS 1.3 signs the negotiation so tampering is detected; servers should disable old versions.
- Implementation bugs Heartbleed (CVE-2014-0160, 2014) let anyone read up to 64 KB of an OpenSSL server’s memory at a time, including private keys.
- Stripping HTTPS an attacker keeps the victim on plain HTTP. HSTS tells browsers to use only HTTPS for a site.
- Interception company proxies decrypt TLS for inspection using their own root installed on devices: useful for defence, and a high-value target.
Lesson complete
You finished “Certificates and TLS”
Nicely done.