Перейти к содержимому
Skip to content
← All articles

TLS Handshake Explained: Step-by-Step Guide to Secure Connections

What Is the TLS Handshake?

The TLS (Transport Layer Security) handshake is the process by which a client and server establish an encrypted connection. Every time you visit an SSL/TLS проверку website, a TLS handshake occurs before any application data is exchanged. Understanding this process is essential for diagnosing connection issues, optimizing performance, and configuring secure servers.

TLS 1.2 Handshake: Step by Step

The TLS 1.2 handshake requires two round trips between client and server before encrypted data can flow. Here is a detailed breakdown:

Round Trip 1: Hello and Key Exchange

  1. ClientHello: The client sends supported cipher suites, TLS version, a random number (client random), and optional extensions like SNI (Server Name Indication).
  2. ServerHello: The server selects a cipher suite, sends its random number (server random), and its digital certificate containing the public key.
  3. Certificate Verification: The client validates the server certificate against trusted Certificate Authorities (CAs), checks expiration, revocation status, and domain match.
  4. Key Exchange: Using the selected algorithm (RSA or Diffie-Hellman), both parties derive the pre-master secret.

Round Trip 2: Finishing the Handshake

  1. Client Finished: The client sends a ChangeCipherSpec message and an encrypted Finished message using the derived session keys.
  2. Server Finished: The server sends its own ChangeCipherSpec and Finished message.
  3. Secure channel established: Application data can now flow encrypted in both directions.
Client                          Server
  |--- ClientHello ------------------>|
  |<-- ServerHello, Certificate ------|
  |<-- ServerKeyExchange, Done -------|
  |--- ClientKeyExchange ------------>|
  |--- ChangeCipherSpec, Finished --->|
  |<-- ChangeCipherSpec, Finished ----|
  |=== Encrypted Application Data ===|

TLS 1.3: The Faster Handshake

TLS 1.3, finalized in 2018 (RFC 8446), dramatically simplifies and accelerates the handshake process. The most significant improvement is reducing the handshake from two round trips to just one.

Key Improvements in TLS 1.3

Client                          Server
  |--- ClientHello + KeyShare ------->|
  |<-- ServerHello + KeyShare --------|
  |<-- {EncryptedExtensions} ---------|
  |<-- {Certificate, Finished} -------|
  |--- {Finished} ------------------->|
  |=== Encrypted Application Data ===|

TLS 1.2 vs TLS 1.3 Comparison

FeatureTLS 1.2TLS 1.3
Handshake round trips2 RTT1 RTT (0-RTT for resumption)
Forward secrecyOptional (depends on cipher)Mandatory
Cipher suites37+ (many insecure)5 (all secure)
Certificate encryptionPlaintextEncrypted
RSA key exchangeSupportedRemoved
0-RTT resumptionNot availableSupported

Performance Implications

The performance difference between TLS 1.2 and 1.3 is significant, especially on high-latency connections:

Optimizing TLS Performance

# Recommended nginx TLS configuration
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;

Common Handshake Failures

Conclusion

The TLS handshake is the foundation of secure web communication. Migrating to TLS 1.3 delivers both stronger security and better performance. Prioritize TLS 1.3 support in your server configuration, ensure certificates are properly managed, and regularly audit your TLS setup to maintain a fast and secure connection for all users.

Check your website right now

Check now →
More articles: SSL/TLS
SSL/TLS
How to Check a Website's SSL Certificate: Step-by-Step Guide
12.03.2026 · 12 views
SSL/TLS
SSL Certificate Monitoring: Avoiding Downtime
14.03.2026 · 10 views
SSL/TLS
TLS 1.3: What Changed and Why It Matters
16.03.2026 · 13 views
SSL/TLS
SSL Pinning: What It Is and When to Use It
16.03.2026 · 18 views