HTTPS je samo HTTP koji radi unutar TLS-om enkriptiranog kanala. TLS (Transport Layer Security) daje vam tri jamstva: confidentiality (promet je enkriptiran), integrity (ne može se neopaženo mijenjati) i authentication (stvarno razgovarate sa serverom navedenim u certifikatu). Pregovara se u handshakeu prije nego se pošalje ijedan 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)
