Skip to content
IT glossary
SecurityUpdated December 3, 2026

TLS handshake

TLS-рукопожатие

This is the opening exchange that sets up a secure connection. The client and server agree on TLS settings and derive encryption keys, and the client usually verifies the server’s identity.

What the handshake does

An encrypted connection is only useful if you know who is on the other end. When a browser opens an HTTPS site, the TLS handshake sets up encryption and lets the browser verify that it reached the site it intended to visit. The two sides derive symmetric traffic keys instead of sending them over the network. Those keys let TLS protect application data from being read or altered in transit.

A typical TLS 1.3 handshake

Here is what happens on a new connection that uses a server certificate:

  1. ClientHello: The client offers TLS versions and cryptographic settings and sends a public key share. It usually includes the hostname using Server Name Indication (SNI), so a server that hosts multiple sites can select the right certificate.
  2. ServerHello: The server selects compatible settings and sends its own public key share. Each side combines the peer’s public share with its own private value to compute the same shared secret. They derive keys to protect the rest of the handshake.
  3. Certificate and CertificateVerify: The server sends its certificate and signs the handshake transcript so far to prove that it holds the corresponding private key. The client verifies the signature, checks that the certificate chains to a trusted authority, and checks the certificate’s validity period and hostname coverage.
  4. Finished: Each side sends a keyed check of the handshake transcript. The receiver verifies it to confirm that both sides saw the same exchange and that the sender derived the expected handshake keys. Application data uses separate traffic keys.

Example: the certificate is trusted, but the site still fails

Suppose you open shop.example and the server presents a certificate valid only for api.example. The browser should reject the connection even if the certificate is current and issued by a trusted authority. Trusting the issuer is only one part of verification: the certificate also has to cover the name the browser connected to.

Where it matters in practice

TLS handshakes also protect connections for gRPC, databases, and other services that use TLS. For HTTPS over TCP, the TCP handshake establishes the transport connection first; the TLS handshake secures it. Several HTTP requests can reuse the same connection without repeating the TLS handshake. In ordinary HTTPS, only the server presents a certificate. With mutual TLS (mTLS), the client also presents a certificate and proves it holds the matching private key. That authenticates the client at the TLS layer, not necessarily the person using the application.

What interviewers ask

A common question is whether the server’s certificate encrypts HTTP requests. In TLS 1.3 it does not: the certificate and its associated signature authenticate the server, the key exchange establishes a shared secret in a typical full handshake, and symmetric keys derived from that secret protect the requests and responses.