Before encrypted communication begins, the client and server perform a TLS handshake:
- Client Hello: The client sends supported TLS versions, cipher suites, and the SNI (server name)
- Server Hello: The server responds with its chosen cipher suite and TLS certificate
- Certificate verification: The client verifies the server's certificate against trusted Certificate Authorities
- Key exchange: Both parties generate shared encryption keys using asymmetric cryptography
- Encrypted session: All subsequent data is encrypted with the shared keys
TLS 1.3 reduces this to a single round trip, improving performance.