Skip to the guide

HTTPS and TLS

BeginnerConcept3 pages

HTTPS is HTTP sent through TLS, a protocol that does three jobs: it proves the server is who it claims to be, keeps the conversation private, and makes tampering detectable. Every public design you draw uses it, so interviewers rarely ask "would you use HTTPS?". They ask where the encryption starts and ends, and what it costs.

A courier from your bank

A courier knocks and says he's from your bank. You don't take his word for it. You check his ID card: his name and photo, in date, issued by an office you trust. Then you agree a code with him, so anyone listening at the door hears only nonsense.

  • the courier → whoever holds the certificate: the server, or here the load balancer in front of it
  • the ID card → certificate: says "this key belongs to shop.example.com"
  • the issuing office you trust → certificate authority (CA), such as Let's Encrypt; browsers and phones ship with a list of trusted ones
  • checking name, photo and dates → the browser checking the name, the signature and the expiry date
  • agreeing a code → key exchange: both sides end up with the same secret key
  • talking in code → encryption of every request and response