HTTPS n'est que du HTTP tournant à l'intérieur d'un canal chiffré par TLS. TLS (Transport Layer Security) vous donne trois garanties : la confidentialité (le trafic est chiffré), l'intégrité (il ne peut pas être altéré sans détection) et l'authentification (vous parlez réellement au serveur nommé dans le certificat). Il est négocié lors d'un handshake avant l'envoi de tout 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)
