Networking / HTTPS

HTTPS

Follow one request to example.com, first as plain HTTP and then wrapped in TLS, to see what HTTPS hides, what it proves, and what a watcher can still see.

Beginner7 steps~7 min
Browser — sends the request
Server — example.com, holds the certificate
Watcher — anyone on the network path
// THE SHORT VERSION

In 30 seconds

HTTPS is ordinary HTTP sent through a TLS connection. TLS encrypts everything the browser and server say, detects any change made in transit, and checks, using a certificate, that the server really owns the name in the address bar.

Someone watching the network still sees which server you talk to, usually its name, and how much data moves and when.

The padlock means the connection is protected. It does not mean the site at the other end is trustworthy.

HTTPS, step by step

STEPS01 / 07

Follows TLS 1.3, simplified. Encrypted DNS and Encrypted Client Hello can hide the site name too; address, sizes and timing stay visible. Chrome replaced its padlock with a neutral icon in 2023.

STEP 01 / 07 Plain HTTP is a postcard
THE MATH
http://example.com port 80, plain text
  1. Step 1: Plain HTTP is a postcard. Plain HTTP sends every request and reply as readable text. Anyone on the path (the Wi-Fi owner, a router, the internet provider) can read the password, and could change the page on its way back.
  2. Step 2: Put HTTP inside TLS. HTTPS is not a new language. It is the same HTTP, placed inside a TLS connection (Transport Layer Security) that runs over TCP, by default on port 443. Everything HTTP says is encrypted before it reaches the network.
  3. Step 3: Hello: agree on a key. The browser and server open with hello messages that each carry the public half of a key exchange. From its own secret half and the other side’s public half, each computes the same key K. The watcher saw both public halves, which is not enough to compute it.
  4. Step 4: Server proves who it is. A shared key is useless if it is shared with an impostor. So the server sends a certificate: a statement signed by a certificate authority (CA) that this public key belongs to example.com. The server then signs the handshake with the matching private key, proving the certificate is its own.
  5. Step 5: Encrypted, tamper-evident. Now every HTTP message travels as TLS records encrypted with the shared key. Each record carries an authentication tag computed from the key and the contents, so a record changed in transit fails the check and the connection is closed. That gives confidentiality and integrity.
  6. Step 6: What a watcher still sees. TLS hides contents, not the fact of the conversation. A watcher still learns the server’s address, usually the site name (from the DNS lookup and the unencrypted hello), how much data moved and when. The path, headers, cookies and page stay hidden.
  7. Step 7: What the padlock means. The padlock says one thing: this connection is encrypted and reaches a server holding a valid certificate for the name in the address bar. It says nothing about who runs that site or what they do with your data. The certificate vouches for a name, not for good intentions.
VALUES SO FAR
httpport 80plain
https····TLS
key K····secret
cert····public
record····wire
visible····leak
hidden····private
padlock····meaning

Spotted a mistake on this page?