PKI and TLS in practice
What the padlock really proves, and how it breaks
Certificates, certificate authorities and the chain of trust, explained step by step. See what a TLS handshake proves, how to automate renewal, and how to debug the three most common certificate failures.
intermediate level, 16 minutes, 18 slides.
PKI and TLS in practice
Welcome. Certificates, certificate authorities and the chain of trust, explained step by step. See what a TLS handshake proves, how to automate renewal, and how to debug the three most common certificate failures. This talk runs about 16 minutes.
Who is on the other end?
When your browser connects to a website, how does it know it reached the real site and not an impostor? Certificates are the answer.
Encryption alone is not enough. You could have a perfectly private conversation with the wrong person. Certificates solve the other half: knowing who you are talking to.
Terms in plain words
| Term | Plain meaning |
|---|---|
| TLS | The protocol that secures a connection (the S in HTTPS) |
| Certificate | A signed file that links a name to a public key |
| Public and private key | A matched pair: the private one stays secret |
| CA | Certificate authority: a trusted issuer of certificates |
| PKI | Public key infrastructure: CAs, certificates and the rules around them |
Five words carry this whole deck. A certificate says this name belongs to this public key, and a certificate authority signs that statement so others can trust it.
What a certificate contains
- The names it covers (for example www.example.com)
- The server's public key
- Start and end dates of validity
- Who issued it
- The issuer's signature
Names that matter live in the Subject Alternative Name field. RFC 9525 says the Common Name must not be used to identify a service.
Think of it as a passport. It has a name, a photo, which here is the public key, dates, and a stamp from the issuer. Clients check the Subject Alternative Name list for the host name, not the old Common Name field.
Chain of trust
Each certificate is signed by the one above it. Your device already trusts the top.
- Root CA certificate: built into your operating system or browser
- Intermediate CA certificate: signed by the root, does the daily issuing
- Leaf certificate: your website, www.example.com
Trust flows downward. Your device ships with a list of root certificates it trusts. The root signs an intermediate, the intermediate signs your site. If every signature checks out and the dates are valid, the chain is accepted.
What is a CA, and who trusts it
A certificate authority is a trusted entity that issues and revokes public key certificates.
- Public CAs are trusted by default in browsers
- A private CA is run by your own organisation
- Devices must be told to trust a private CA
Try it: Validate X.509 Certificate Paths From Scratch (and Break the Naive Ones)
Public CAs serve the open internet. Private CAs serve inside a company, for internal sites and services. A private CA only works on devices where you have installed its root certificate, so guard that root carefully.
What a TLS handshake proves
Simplified TLS 1.3 handshake.
- Client hello: I speak these options
- Server hello: key agreed
- Certificate: here is my chain
- Certificate verify: signature with my private key
- Finished: encrypted data begins
The server sends its certificate chain. Then it proves it holds the matching private key by signing the whole handshake. The client checks the chain, the name and the dates. If all pass, both sides carry on with encrypted traffic.
Proves and does not prove
A valid handshake proves
- The server holds the key for this certificate
- A trusted CA vouched for the name
- The channel resists eavesdropping and tampering
- The server side is authenticated
It does not prove
- The site is honest or safe
- The owner is who you expect, in a human sense
- The server software is patched
- Anything about the client, unless mutual TLS is used
The padlock means the connection is private and the name matches. It does not mean the site is trustworthy. Criminals can get certificates for their own look-alike domains.
Inspect it with openssl
Connect to a server you own and read its certificate. example.com is a placeholder.
openssl s_client -connect www.example.com:443 -servername www.example.com -showcerts </dev/null
openssl s_client -connect www.example.com:443 -servername www.example.com </dev/null 2>/dev/null \
| openssl x509 -noout -subject -issuer -dates -ext subjectAltName- -servername sends the host name (SNI)
- -showcerts prints the certificate list as the server sent it
- Look for the verification result near the end
This is the first tool to reach for. The first command shows the whole chain the server sends. The second pulls out the fields you care about: who it is for, who issued it, and when it expires. Always check the verification result near the end of the output.
Failure 1: expired
Every certificate has an end date. After it, clients refuse the connection.
- Symptom: browser warns the certificate has expired
- Check: notAfter date in openssl x509 -dates
- Cause: renewal was manual and forgotten
- Fix: renew, then automate and monitor
Try it: Monitor TLS certificate expiry with a Python script
Expiry is the most common failure because it happens on a schedule and people forget. The fix is not a better calendar reminder. It is automation plus an alert well before the date.
Failure 2 and 3: wrong name, missing intermediate
| Failure | What you see | Cause | Fix |
|---|---|---|---|
| Wrong name | Name mismatch error | Host not in the Subject Alternative Name list | Reissue with the right names |
| Missing intermediate | Works in some clients, fails in others | Server sent only the leaf certificate | Serve the full chain |
| Untrusted issuer | Unknown authority | Private CA root not installed | Distribute the root to devices |
Missing intermediates hide because some clients cache or fetch them. Test with a clean client.
Wrong name means the certificate is fine but for a different host. Missing intermediate is sneaky: your own browser may have it cached, while a phone or a script does not. Always test from a clean machine.
Automate issuance with ACME
ACME is a standard protocol a CA and an applicant can use to automate domain verification and certificate issuance, so no person has to click through forms.
- Prove control. Show you control the domain name.
- Request. Client asks the CA for a certificate.
- Install. Server loads the new certificate.
- Renew. A timer repeats this before expiry.
Try it: Automate TLS certificates with ACME (locally, no public domain)
ACME lets a CA and an applicant automate verification and issuance. The client proves it controls the name, receives a certificate, and repeats on a timer. Nobody has to remember anything.
Certificate lifetimes are shrinking
Let's Encrypt announced that certificates it issues, currently valid for 90 days, will be cut to 45 days by 2028.
- Shorter lifetimes limit damage from a stolen key
- Manual renewal stops being realistic
- Automation is the only safe plan
Public certificates are getting shorter-lived. That is good for security because a leaked key stops working sooner, but it makes manual renewal impossible. If you still renew by hand, now is the time to automate.
CAA: say who may issue for you
A CAA record is a DNS entry that names the certificate authorities allowed to issue certificates for your domain. It helps reduce unintended mis-issuance.
Zone file lines for example.com. The CA name is a placeholder.
example.com. 3600 IN CAA 0 issue "ca.example.net"
example.com. 3600 IN CAA 0 iodef "mailto:security@example.com"Try it: Restrict certificate issuance with CAA and test the policy
CAA is a short list at your domain that says: only these authorities may issue for me. Public CAs can check it before issuing. It is cheap and easy, and it narrows who can make a mistake on your behalf.
Check yourself
Check yourself: Your site works in your browser but a script says the issuer is unknown. Most likely cause?
Answer: The server did not send the intermediate certificate. Browsers may cache intermediates. Other clients need the server to send the full chain.
Check yourself: What does a CAA record do?
Answer: Lists which CAs may issue certificates for the domain. RFC 8659: it lets a domain holder specify the authorised certificate authorities.
Check yourself: Does a valid TLS handshake prove a website is safe to use?
Answer: No, it proves the server holds the key for a name a CA vouched for. Authentication of the name is not a verdict on the site's honesty.
Three questions covering the main ideas.
Take-aways
- A certificate binds a name to a public key
- Trust flows from a root through intermediates
- The handshake proves key ownership, not honesty
- Expired, wrong name and missing intermediate are the usual breaks
- Automate renewal, monitor expiry, add CAA
Certificates are not magic. They are signed statements, checked in a chain. Keep them short-lived, automated and monitored, and most of the pain disappears.
Practise this
- Validate X.509 Certificate Paths From Scratch (and Break the Naive Ones)
- Automate TLS certificates with ACME (locally, no public domain)
- Restrict certificate issuance with CAA and test the policy
- Monitor TLS certificate expiry with a Python script
Slides only get you so far. Pick one of these hands-on labs and do it today while it is fresh. Every lab is free.
Sources
- NIST Computer Security Resource Center glossary: Certificate Authority
- RFC 9525, Service Identity in TLS
- RFC 5280, Internet X.509 PKI Certificate and CRL Profile
- RFC 8446, The Transport Layer Security (TLS) Protocol Version 1.3
- OpenSSL docs: openssl-s_client
- OpenSSL docs: openssl-x509
- RFC 8555, Automatic Certificate Management Environment (ACME)
- Let's Encrypt, Decreasing Certificate Lifetimes to 45 Days (2 December 2025)
- RFC 8659, DNS Certification Authority Authorization (CAA) Resource Record
Every claim in this deck came from these pages, fetched and checked for this release. Read the originals.
Hands-on labs for this deck
- Validate X.509 Certificate Paths From Scratch (and Break the Naive Ones)
- Automate TLS certificates with ACME (locally, no public domain)
- Restrict certificate issuance with CAA and test the policy
- Monitor TLS certificate expiry with a Python script
- Perform a TLS 1.3 handshake from scratch: hand-built ClientHello, X25519, the RFC 8446 key schedule, and decrypt the server's first encrypted record
Open the interactive deck or see all slide decks.
Related
- Validate X.509 Certificate Paths From Scratch (and Break the Naive Ones)
- Automate TLS certificates with ACME (locally, no public domain)
- Restrict certificate issuance with CAA and test the policy
- Monitor TLS certificate expiry with a Python script
- Perform a TLS 1.3 handshake from scratch: hand-built ClientHello, X25519, the RFC 8446 key schedule, and decrypt the server's first encrypted record
- All slide decks
- Free cyber labs