HTTPS je jen HTTP běžící uvnitř kanálu šifrovaného pomocí TLS. TLS (Transport Layer Security) vám dává tři záruky: confidentiality (provoz je šifrovaný), integrity (nelze do něj nepozorovaně zasáhnout) a authentication (skutečně mluvíte se serverem uvedeným v certifikátu). Vyjednává se v handshaku předtím, než se pošle jakékoli HTTP:
Client Server
│──── ClientHello ──────────────────────▶│ (TLS versions, cipher suites, random)
│◀─── ServerHello + Certificate ─────────│ (chosen cipher + cert with public key)
│ │
│ verify cert against a trusted CA │
│ agree on keys (e.g. ECDHE key exchange)│
│ │
│──── Finished (encrypted) ──────────────▶│
│◀─── Finished (encrypted) ───────────────│
│========= encrypted application data ====│ (now HTTP flows, encrypted)
