Think of a postcard that you send by mail. Everyone who touches it on the way can read the back: the postal worker at pickup, the sorter, the carrier. That’s the regular internet without TLS.
Now put that postcard into a locked metal box. Only the person you send it to has the key. If someone steals the box on the way, they still can’t see inside. That’s TLS.
This post is the foundation. No OpenSSL, no hands-on work. At the end you’ll know what TLS does and how your browser decides who to trust. You’ll also know what every operating system on earth ships, and why the whole system rests on one mathematical asymmetry. Each section takes two minutes. Read from top to bottom.
In Simple Words#
- The problem
- Without TLS, your data travels like a postcard. Anyone on the path can read it or change it. You also cannot be sure that the server is the real one.
- The root cause
- On the internet, your data crosses a path that other people can access. And you never meet the server in person, so you cannot hand it a key or check who it is.
- The solution
- TLS does three jobs: it encrypts the data, checks who the server is, and seals the data against changes. Your browser checks every site’s certificate against a list of trusted roots.
- Think of it like this
- A king seals his letters with a ring that only he has. Everyone knows what the seal looks like, so everyone can check a letter. But nobody can make the seal without the ring. The ring is the private key. The look of the seal is the public key.
What We’ll Cover#
- TLS in one image
- The three jobs TLS does
- How you know it’s on
- SSL vs TLS — the name confusion
- How authentication works — the chain of trust
- The TLS handshake, step by step
- Two crypto types, two jobs
- What your browser actually ships
- The asymmetry that makes everything work
1. TLS in One Image#
Without TLS, your data on the internet is a postcard. The mailman reads it. The sorting worker reads it. Anyone with access to the path between you and the destination reads it.
With TLS, the postcard is inside a locked metal box. The recipient holds the only key that fits. The carriers still move the box from sender to receiver, but none of them can see inside.
That’s the picture. Everything below explains how the box works over a network. The hard part: you never meet the recipient in person to hand them a key.
2. The Three Jobs TLS Does#
TLS does exactly three things when your computer talks to a server:
| Job | The postcard analogy | What it stops |
|---|---|---|
| Encryption | The locked box — only the recipient can open it | Eavesdropping (reading the data in transit) |
| Authentication | Verifying the box really belongs to the recipient | Impersonation (talking to a fake server) |
| Integrity | A tamper-proof seal on the box | Tampering (someone editing the data in transit) |
Encryption is the easy half. Both ends agree on a scrambling rule and use it. The really hard half is authentication. You must know that the “recipient” on the other end is really who they say they are. The rest of this post is about that one problem.
3. How You Know It’s On#
You don’t have to read the protocol to know that TLS is working. Your browser tells you:
- 🔒 padlock icon +
https://— TLS is on. The conversation is encrypted and the browser has checked the server’s identity. - ⚠️ “Not secure” +
http://— no TLS. Anyone in the path can read and change the traffic.
The “S” in HTTPS stands for Secure. It means TLS does the work below HTTP. When your browser shows a green padlock, three things have already happened in the background. A certificate was checked. The two sides agreed on a key. The traffic switched to encrypted mode. The rest of this post explains how.
4. SSL vs TLS — The Name Confusion#
You’ll see both names. They mean the same thing in different generations.
- SSL was the original (1990s). The last version, SSL 3.0, had real vulnerabilities (security holes) and was retired years ago.
- TLS replaced it. Current versions are TLS 1.2 (2008) and TLS 1.3 (2018, what almost everything uses now).
People still say “SSL” out of habit. If a vendor sells you an “SSL certificate” in 2026, it’s a TLS certificate. The name is old, but the protocol has moved on.
5. How Authentication Works — The Chain of Trust#
This is the most important part of TLS. Your browser connects to bank.example.com. How does it know that it is talking to the real bank? An attacker on the same Wi-Fi could set up a server that looks the same.
The answer is a chain of trust. Your browser and operating system come with a list of root certificates already installed: DigiCert, Let’s Encrypt, GoDaddy, and roughly 150 others. Each root belongs to a certificate authority (CA), an organization that signs certificates. This list is called the trust store. In the end, the identity of every site leads back to one of these roots.
But root CAs don’t sign sites directly. Roots stay offline in physical vaults. They sign intermediate CAs, and the intermediates do the daily work of signing real websites.
When you visit example.com, the server sends back its own certificate plus any intermediate certificates needed to complete the chain. Your browser walks up the chain: leaf → intermediate → root. It checks each signature until it reaches a root it already trusts.
Why the extra layer? Imagine that a root CA’s private key leaks. Every certificate that CA ever signed would become invalid overnight. So roots stay offline, and intermediates do the daily signing. If an intermediate is compromised, it can be revoked (cancelled) without destroying the whole trust tree. The system is built to survive when one part of it is broken into.
6. The TLS Handshake, Step by Step#
Here’s what happens in the first ~100 milliseconds when your browser opens an HTTPS site:
In words:
- ClientHello — your browser tells the server which TLS versions and cipher suites it supports, and sends a random number. A cipher suite is a set of encryption methods.
- ServerHello + Certificate — the server picks a version and a cipher. It sends its random number and its full certificate chain.
- Verify the cert — your browser walks the chain. Is the signature valid? Is the cert in date? Does the name in the cert match the hostname you typed? Has it been revoked (OCSP or CRL)? If any check fails, you get the “not secure” warning.
- Key exchange — both sides run a Diffie-Hellman exchange. The clever part: both ends arrive at the same shared secret key, but the key itself never travels over the network. An attacker who records every byte still cannot work it out.
- Switch to symmetric — both sides now hold the same key. They stop using the slow asymmetric crypto and switch to fast symmetric encryption (AES) for the real data.
Steps 1–4 are the handshake. Step 5 is the encrypted conversation. The handshake takes a few milliseconds and happens once per connection.
7. Two Crypto Types, Two Jobs#
That last point is more important than it sounds. TLS uses two different kinds of cryptography. Each one does the job it is good at.
| Type | Examples | Used for | Why |
|---|---|---|---|
| Asymmetric | RSA, ECDSA | Handshake, signing certs | Solves the “how do we share a key” problem |
| Symmetric | AES, ChaCha20 | Encrypting the actual data | 100–1000× faster than asymmetric |
Asymmetric crypto has a special property: a public key can verify what a private key signed. That’s how identity works. But it’s slow and expensive. Symmetric crypto is fast and cheap, but both sides need the same key. And that is exactly the problem the asymmetric handshake has just solved.
TLS uses the slow half, which is good for identity, to start the fast half, which is good for large amounts of data. Identity first, speed second.
8. What Your Browser Actually Ships#
A natural question comes after all this. Your OS and browser ship with “certificates” from DigiCert, Let’s Encrypt and GoDaddy. Did those companies hand over their secrets, to be put into every Chrome install on earth?
No. And this is the most important idea in public-key cryptography.
What’s shipped is each CA’s public key, inside a public certificate. The private key never leaves the CA. It sits in a hardware security module, in a vault. Often several people are needed to access it.
| Key | Who has it | What it does |
|---|---|---|
| Public key | Everyone (shipped in your browser) | Verifies signatures |
| Private key | Only the CA — locked in a vault | Signs certificates |
Anyone with the public key can verify a signature. But nobody can forge (fake) a signature without the matching private key, even with the public key. It works in one direction only.
Think of a king’s wax seal in the Middle Ages. The king has a unique signet ring. That’s the private key, kept under guard. Everyone in the kingdom knows what the king’s seal looks like. That’s the public key, shared openly. When a letter arrives with the seal pressed into the wax, anyone can check that it’s real. But nobody can forge the seal without the ring.
Shipping CA public keys to every browser is the same trick. Every device in the world learns what the seal looks like, and the ring is never at risk.
9. The Asymmetry That Makes Everything Work#
Reduce TLS to the one idea you’d keep if you forgot everything else:
- Public keys are everywhere. They verify. Losing one costs nothing.
- Private keys exist only where they belong. They sign. Losing one is a disaster.
That asymmetry is simple: verify with the public key, sign with the private key. It is the building block below TLS, SSH, code signing, package signing, and every crypto wallet you’ve ever heard of. The protocols differ, but the trick below them is the same one.
When you see the padlock in your browser, it really means one thing. The server proved it holds a private key, and someone my browser already trusts signed the public half. That one sentence is the whole foundation.
What You Have Now#
| Concept | The takeaway |
|---|---|
| TLS in one image | The locked box, not the postcard |
| The three jobs | Encryption, authentication, integrity |
| The chain of trust | Roots stay offline; intermediates sign daily; your browser walks the chain to a root |
| The handshake | Asymmetric to bootstrap a key; symmetric for the actual data |
| The big asymmetry | Public keys verify, private keys sign — the private half never moves |
You now have the mental model. Everything else is a variation on these same ideas: internal CAs, certificate transparency, mTLS, OCSP stapling.
Next Steps#
- Self-Host Harbor Image Registry on Debian — use what you learned here. Build your own CA, sign certs for an internal registry, and connect it to a GitLab Runner from start to end.
- Linux Server Security Baseline — for when you become your own CA. The host that holds the private key is then the most powerful machine on your network. Harden it to match.