TLS Handshake Explained: What Happens Before HTTPS Loads
Before a browser can request an HTTPS page, it must establish a secure connection with the web server. This negotiation is called the TLS handshake. It allows the two endpoints to agree on protocol settings, authenticate the server, and create shared encryption keys before application data is exchanged.
For most visitors the process is invisible and completes in a fraction of a second. When it fails, however, the result may be a certificate warning, a connection error, or a website that appears unavailable even though the server itself is running.
The Client Starts With ClientHello
The browser opens a TCP connection and sends a ClientHello message. It includes the TLS versions and cryptographic options the client supports, a random value, and key-exchange information. It can also include the requested hostname through Server Name Indication, allowing one IP address to host several HTTPS websites with different certificates.
Modern clients usually offer TLS 1.3 while retaining compatible fallback options where necessary. The server must select parameters that both sides support. If no acceptable version or algorithm exists, the handshake stops before any HTTP request is sent.
The Server Selects Parameters and Proves Its Identity
The server replies with ServerHello and chooses the protocol version and cryptographic parameters. It also sends its certificate chain and a signature that proves possession of the certificate’s private key.
The browser then validates the chain to a trusted certificate authority, checks that the certificate covers the requested hostname, and verifies its validity period. Our introduction to SSL certificates and HTTPS protection explains the trust model in more detail.
An expired certificate, missing intermediate certificate, incorrect hostname, or untrusted issuer can all interrupt this stage. Planned renewal and deployment checks help prevent these avoidable failures; use our SSL certificate renewal checklist before a certificate reaches its expiry date.
Both Sides Derive Shared Session Keys
The client and server combine their key-exchange values to independently derive the same session secrets. They do not send the final symmetric encryption keys across the network. Finished messages confirm that both parties calculated the expected secrets and that the handshake was not altered in transit.
Once verification is complete, the connection carries encrypted application data. The browser can finally send its HTTP request, and the server can return the page without exposing the contents to passive observers or allowing undetected modification.
Session Resumption Reduces Repeat Work
A server may provide information that lets a returning client resume a previous session. Resumption reduces cryptographic work and can save a network round trip. TLS 1.3 also defines early data, commonly called 0-RTT, but applications must use it carefully because replayed early requests can create security risks.
Troubleshoot the Handshake Separately From HTTP
When HTTPS fails, first confirm DNS resolution, reachability on port 443, certificate validity, hostname coverage, and the complete certificate chain. Then check supported TLS versions and inspect server logs. The command-line checks in our guide to testing websites with curl help separate TLS failures from HTTP status and redirect problems.
For the current protocol definition and complete TLS 1.3 handshake flows, consult Section 2 of RFC 9846. Understanding these stages makes certificate errors easier to diagnose and explains why a healthy HTTPS connection depends on more than simply installing a certificate.