Why certificates exist

A public key is worthless until something proves whose it is

Without a certificateBenattacker in the middlebank.combank.com’s real keyattacker’s key: “I am bank.com”nothing proves whose key it isWith a certificateBenkey + name, signed by a CAbank.comsends its certificateBen checks the CA’s signaturea swapped key fails the checkA public key alone proves nothing; a certificate binds it to a name, signed by someone you already trust.Public-key cryptography only helps if you have the right key. An attacker in the middle can hand out their ownkey and read everything. A certificate authority (CA) checks who controls bank.com, then signs a statement:this key belongs to this name, until this date. That signed statement is the certificate.

A certificate authority signs a certificate binding a public key to a name, stopping on-path attacks.

X.509 certificates

A certificate is a signed card: who, which key, until when

SubjectCN=www.example.comAlt names (SAN)example.com, www.example.comIssuerExample Issuing CA 2Valid2026-11-01 to 2027-05-20Public keyECDSA P-256Key usagedigital signature, server authSerial number04:a1:7c:9e:52:…SignatureECDSA with SHA-256, by the issuerWho: the names it is valid forIssuer: the CA that vouches for itWhen: 200 days, the maximum since March 2026What: the server’s public key and its allowed usesSerial: unique, so it can be revokedProof: the CA’s signature over every field aboveA certificate is a signed record: who, which key, valid when, and who vouches for it.Its format is X.509. Browsers match the site against the Subject Alternative Name (SAN) list, not the old CommonName. The issuer signs a hash of every field, so changing a single character breaks the signature.

An X.509 certificate holds the subject alternative name list, issuer, validity, public key, serial and signature.

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.

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

PEMBase64 text between BEGIN and END lines: .pem, .crt, .key
DERthe same data in binary: .der, .cer
PKCS#12.pfx or .p12: certificate, chain and private key, protected by a password
PKCS#7.p7b: certificates and chain, never the private key
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.

Chain of trust

Your device trusts a few roots; every site borrows that trust

Root CAself-signed · valid for decades · kept offlinesignsIntermediate CAsigned by the root · issues every daysignswww.example.comsigned by the intermediate · 200 daysThe browser’s trust storeroot certificates shipped with the OS and browser1 The server sends its certificate and the intermediate2 The browser checks each signature, leaf up to root3 The chain must end at a root already in the store4 Only then is the server’s public key trustedTrust flows down a chain: your device trusts a root, the root vouches for an intermediate, the intermediate for the site.Roots are few, rarely used and kept offline in hardware security modules; intermediates do the daily signing, so acompromised intermediate can be revoked without replacing roots on billions of devices. A self-signed certificatehas no chain at all, which is why browsers warn about it.

A chain of trust runs from a root CA in the trust store through an intermediate CA to the site.

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.

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

JunJulAugSep17 Junattacker breaks in through web servers10 Julrogue *.google.com certificate issued10–20 Julat least 531 rogue certificatesfrom 4 Augused on ~300,000 IPs, 99% in Iran29 AugChrome’s key pinning exposes it; revokedearly Sepbrowsers and OS vendors distrust its rootsSep 2011DigiNotar is bankruptOne breached CA could impersonate any website, so the whole system had to learn to watch CAs.In 2011 an attacker took over Dutch CA DigiNotar and issued rogue certificates for Google and others, used to readIranian users’ Gmail. Logs were wiped, so the full count is unknown. Browsers removed DigiNotar’s roots and thecompany collapsed within weeks. The lesson led to Certificate Transparency.

The DigiNotar breach (2011) produced at least 531 rogue certificates and ended with the CA distrusted.

Chain of trust · Going deeper · 3 of 4

Every certificate is logged in public, so fakes are caught fast

CA1 logs every certificatepublic CT logs, append-only2 signed receipts (SCTs)certificate + SCTs3 checkedno SCTs, no trustyour monitor reads the logs4 an unexpected certificate“bank.com, from a CA we never use”Every public certificate is now written to public logs, so a mis-issued one cannot stay hidden.Browsers such as Chrome and Safari refuse certificates without proof (SCTs) that they were logged. Anyone cansearch the logs, so a company can watch for certificates on its own names and react in hours, not months.DNS CAA records add prevention: they name the only CAs allowed to issue for a domain.

Certificate Transparency logs every public certificate; browsers require SCTs; owners monitor the logs.

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 (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.

Certificate validation

Five checks stand between you and a fake website

The browser checksFails whenChrome shows (NET::…)Chain ends at a trusted rootself-signed or unknown issuerERR_CERT_AUTHORITY_INVALIDThe name matchesthe site is not in the SAN listERR_CERT_COMMON_NAME_INVALIDToday is within its datesexpired, or not yet validERR_CERT_DATE_INVALIDNot revokedthe CA revoked it, e.g. key stolenERR_CERT_REVOKEDPublicly loggedno Certificate Transparency proofERR_CERTIFICATE_TRANSPARENCY_REQUIREDAny one failure stops the page with a full-screen warning. Clicking through it removes the protection.Before trusting a site, the browser runs five checks on its certificate; failing any one should stop you.Each warning has a distinct cause, which helps when you troubleshoot: an untrusted issuer, a wrong name, a date,a revocation or a missing transparency proof. Training people to click through warnings undoes the whole system.

Browsers check the chain, the name, the dates, revocation and Certificate Transparency.

Certificate lifetimes

Certificates will last 47 days, so renewal must be automatic

Maximum lifetime of a public TLS certificate, drawn to scaleuntil 20151,826 days (5 years)from Apr 20151,186 days (39 months)from Mar 2018825 daysfrom Sep 2020398 daysfrom Mar 2026200 days: todayfrom Mar 2027100 daysfrom Mar 202947 daysFrom 2029 a CA may reuse a domain check for only 10 days, so renewal has to be automatic.Certificate lifetimes are falling from five years to 47 days, so renewal has to be automated.Short lifetimes limit the damage of a stolen key or a mis-issued certificate, and make revocation matter less.The CA/Browser Forum, where CAs and browser makers set the rules, voted the schedule in 2025 (ballot SC-081).An expired certificate takes a site offline just as surely as an attack, which is why teams track every one.

The CA/Browser Forum cut lifetimes to 200 days in 2026, 100 in 2027 and 47 in 2029. ACME automates renewal.

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.

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

Inventoryevery certificate, where it is installed and who owns it
Expiry alertswell before the date, in case automation fails
Key protectionprivate keys in hardware or a key vault
CAA recordslist the CAs allowed to issue for your domains
Expired certificates have taken down major services and hidden attacks: an inspection device with an expired certificate stops inspecting traffic.

Certificate lifetimes · Going deeper · 2 of 2

Cancelling a certificate is easy; getting browsers to notice is not

CRLa signed list of revoked serialnumbers, published by the CAand downloaded by clientscan be large, and hours oldOCSPthe client asks the CA:“is serial 04:a1… still good?”once for each site visitedthe CA sees where you browse;Let’s Encrypt ended it in 2025OCSP staplingthe server fetches a signedOCSP answer and staples itto its own handshakeonly helps if servers enable itShort lifetimesa 47-day certificate soonexpires on its own, whetheror not anyone checksneeds fully automated renewalRevoking a certificate is easy; making every client notice quickly is the hard part.A CA revokes a certificate when its key is stolen or it was issued wrongly. Clients learn of it through lists(CRLs) or live queries (OCSP). Both are slow or leak privacy, so browsers ship their own compressed revocationlists, and the industry is leaning on short lifetimes instead. Let’s Encrypt switched off OCSP on 6 August 2025.

Revocation uses CRLs, OCSP or OCSP stapling; short lifetimes now do much of the work.

TLS handshake

TLS 1.3 sets up a secure connection in one round trip

Browserexample.com1 round trip,then data1 ClientHello: TLS 1.3, cipher suites, ECDHE key share2 ServerHello: chosen suite + its own key share3 Certificate · CertificateVerify · Finishedencrypted from here, with keys both sides derived from the two key shares4 Finished + the first HTTP requestTLS 1.3 agrees keys, proves the server’s identity and starts sending data in a single round trip.Both sides send ECDHE key shares in their first messages, so everything after the ServerHello, even thecertificate, is encrypted. CertificateVerify is the server signing the handshake with its private key, provingit holds the key in the certificate. TLS 1.2 needed two round trips and sent the certificate in clear.

TLS 1.3 exchanges ECDHE key shares in the first two messages and encrypts the rest, including the certificate.

TLS handshake · Going deeper · 1 of 2

Stealing tomorrow’s key cannot unlock yesterday’s traffic

RSA key exchange (TLS 1.2 and older, without ECDHE)2026: sessions recorded2028: server key stolenEvery recorded session readthe stolen key unlocks them allEphemeral ECDHE (always, in TLS 1.3)2026: sessions recorded2028: server key stolenNothing to decrypteach session key was discardedWith forward secrecy, stealing a server’s key tomorrow cannot unlock the traffic recorded today.In old RSA key exchange the browser encrypted the session key with the server’s long-term key, so that keyopened every past session. Ephemeral Diffie-Hellman makes fresh key shares per session and throws them away;the long-term key only signs. TLS 1.3 removed RSA key exchange entirely.

Forward secrecy comes from ephemeral ECDHE keys; TLS 1.3 requires it.

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.

Versions

SSL 2.0, 3.0prohibited; SSL 3.0 broken by POODLE (2014)
TLS 1.0, 1.1deprecated by RFC 8996 (March 2021)
TLS 1.2acceptable with ECDHE and AEAD ciphers such as AES-GCM
TLS 1.3RFC 8446 (2018): one round trip, forward secrecy always, legacy ciphers removed

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.

Open in a new tab