Compared
HTTP vs HTTPS
HTTPS is HTTP sent inside TLS. The requests and responses are the same; TLS encrypts them and makes the server prove, with a certificate, that it is the name you asked for. Over plain HTTP anyone on the path can read and change all of it.
Side by side
| HTTP | HTTPS | |
|---|---|---|
| Address starts with | http:// | https:// |
| Default port | TCP 80 | TCP 443 (HTTP/3: UDP 443) |
| Encryption | None: plain text | TLS encrypts every request and response |
| Who the server is | Not proven | A certificate for the name, signed by an authority the client trusts |
| The path can read | Everything: addresses, headers, cookies, bodies | The IP addresses, the ports and usually the server's name in the handshake (SNI) |
| The path can change | Anything | Nothing, without the client noticing and stopping |
Each one explained
- HTTP
- The web's request and response protocol: plain text over TCP unless wrapped in TLS.
- TLS and certificates
- Encryption plus proof of identity: the server shows a certificate for the name, signed by a trusted authority.
- Certificate chain
- A server's certificate, signed by an issuing CA, whose certificate a root signed: the path a client follows to someone it trusts.
- SNI
- The site name sent in the clear at the start of a TLS handshake, so the server can pick a certificate.
See the difference on real machines
Each lab is a small network of real Linux machines in your browser.
Open HTTP: read the requests behind every web page