What Is a TLS Handshake?
A TLS handshake is the process by which a client and server negotiate encryption parameters, authenticate each other, and establish a secure connection. It occurs at the start of every HTTPS session and every SMTP STARTTLS connection.
How the TLS Handshake Works
1. ClientHello: The client sends its supported TLS versions, cipher suites, and a random value. 2. ServerHello: The server selects a TLS version and cipher suite, sends its own random value and SSL certificate. 3. Certificate Verification: The client verifies the server's certificate chain. 4. Key Exchange: Both parties perform a key exchange (ECDHE for forward secrecy) to derive shared session keys. 5. Finished: Both sides confirm the handshake and begin encrypted communication.
TLS 1.2 vs. TLS 1.3 Handshake
TLS 1.2 requires 2 round trips (4 messages) to complete the handshake. TLS 1.3 reduces this to 1 round trip by combining steps and removing unnecessary messages. TLS 1.3 also mandates forward secrecy, removes support for weak algorithms (RSA key exchange, CBC mode, SHA-1), and supports 0-RTT resumption for returning clients.
TLS Handshake and Email
Email servers perform TLS handshakes when using STARTTLS on SMTP connections. The SMTP client issues the STARTTLS command, and both servers perform a TLS handshake before exchanging email data. MTA-STS enforces that this handshake must succeed — if TLS negotiation fails, the email is not sent in plaintext.
Frequently Asked Questions
What happens during a TLS handshake?
The client and server exchange supported algorithms, the server presents its certificate, the client verifies it, both perform key exchange to derive session keys, and encrypted communication begins.
What is the difference between TLS 1.2 and TLS 1.3 handshakes?
TLS 1.3 completes in 1 round trip instead of 2, mandates forward secrecy, removes weak algorithms, and supports 0-RTT resumption. The result is faster, more secure connections.
Why do TLS handshake failures occur?
Common causes include no overlapping cipher suites, expired or invalid certificates, TLS version mismatches, certificate name mismatches, incomplete certificate chains, or firewall interference.