awesome-everything RU
↑ Back to the climb

Networking & Protocols

What TLS does and why it exists

Crux TLS builds a sealed channel over an untrusted network — before TLS 1.3 that took two round-trips; understanding why sets up everything that follows.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at junior altitude — the surface
◷ 8 min

TCP agreed on sequence numbers, DNS resolved a name to an IP. Now the browser and server must agree on encryption before anything that matters can travel. That negotiation is the TLS handshake — and it is the difference between a clear-text postcard and a sealed envelope.

What TLS does in one sentence

TLS (Transport Layer Security) wraps every byte of application data in a symmetric-key envelope that nobody on the network can read. The envelope is negotiated via asymmetric cryptography during the handshake; once negotiated, the symmetric key handles all data at line speed.

Plain HTTP sends every word you type in clear text. Your password, your bank balance, the article you are reading — visible to anyone on the same coffee-shop wifi, your ISP, or a corporate proxy. TLS turns that same wire into a locked tunnel.

The sealed-envelope metaphor

Bea wants to mail Sven a message, but she fears the mailman will read it. She puts it in a box, locks it with a seal, and mails it. Only Sven has a matching key. Before mailing, both agree on the seal and the key: Bea proposes locks she knows, Sven picks one and sends his half of the key plus an ID card from Cara the trusted issuer. They combine halves into a shared seal. TLS 1.3 made the meeting shorter by letting Bea send her half in the first message, instead of waiting for Sven to ask.

Three guarantees TLS provides

  1. Confidentiality — nobody on the wire can read the data.
  2. Integrity — nobody can tamper with the data without detection.
  3. Authentication — the server proves it owns the domain (via a certificate issued by a trusted CA).
TLS 1.3 at a glance
TLS 1.2 cold handshake
2 RTT
TLS 1.3 cold handshake
1 RTT
TLS 1.3 resumed (PSK)
1 RTT (no cert check)
TLS 1.3 0-RTT
0 RTT for request
HTTPS share of web traffic (2025)
≥95%
Browser shows padlock when
TLS handshake succeeded

One scenario end to end

You type https://. The browser has already finished DNS (it knows the IP) and TCP (a connection is open). Now it builds the TLS seal. Once built, every HTTP request and response rides inside it. The browser shows a padlock.

The padlock means: nobody on the network can read what passes between you and this hostname. It does not mean the website is trustworthy — a scam site can have a valid padlock. It does not mean your device is safe. It guarantees only the channel.

Quiz

What does TLS actually protect?

Quiz

The padlock icon in the browser means...

Order the steps

Put the TLS handshake steps in order (simplified):

  1. 1 Bea sends her list of supported ciphers and her half of the key
  2. 2 Sven picks a cipher, sends his half of the key and his certificate
  3. 3 Bea checks the certificate against trusted CAs
  4. 4 Both sides combine their halves into a shared secret
  5. 5 Every message after this point is encrypted
Complete the analogy

Fill in the blank: TLS turns your connection into a sealed _______ that only the website can open.

Why this works

Why TLS 1.3 cut the handshake to one RTT. TLS 1.2 needed two round-trips: one to agree on cipher parameters, then another to exchange key material. TLS 1.3 moved the client’s key material into the very first message — the ClientHello — so the server can compute the shared secret and start encrypting in the same pass. This saves a full network round-trip (80–300 ms on intercontinental links) on every cold connection.

Recall before you leave
  1. 01
    In one sentence: what would happen if you visited a banking site without TLS?
  2. 02
    What three guarantees does TLS provide, and which one does the certificate serve?
  3. 03
    Why did TLS 1.2 need two RTTs and TLS 1.3 needs only one?
Recap

TLS wraps every byte of application data in an encrypted envelope that anyone on the network can see passing but only the sender and receiver can read. It provides three guarantees: confidentiality (encryption), integrity (MAC/transcript hash), and authentication (the server certificate proves domain ownership to a trusted CA). Before TLS 1.3, building this channel cost two network round-trips; TLS 1.3 collapsed it to one by sending the client’s key material in the opening message. The padlock icon means only the channel is sealed — not that the website itself is safe or the device is secure.

Connected lessons
appears again in47
Continue the climb ↑The 1-RTT handshake: key shares and ECDHE
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.