Skip to content
7LayerX

Security / Field note

SSL/TLS handshake basics: how a secure connection starts

Learn the main steps in a TLS handshake, how certificates identify a server, and why people still call it an SSL handshake.

7LayerX Editorialupdated 5 min readTLSHTTPS

Explore by doing

See how a secure connection starts.

A browser and a website exchange messages before they send protected data. Use this visualizer to follow those messages, compare TLS 1.2 and TLS 1.3, and see what happens when a certificate check fails.

  1. 01 / Follow the messages

    Step through ClientHello, ServerHello, certificate checks, and Finished messages.

  2. 02 / Compare versions

    A full TLS 1.3 handshake usually takes one round trip. A full TLS 1.2 handshake usually takes two.

  3. 03 / Try example errors

    Try an expired certificate, a name mismatch, or an untrusted issuer and see how the check changes.

This is a learning simulation. It does not connect to a real website or check live certificates.

Handshake lab SECURITY

A visual walkthrough of TLS messages and certificate checks

Client browserChrome · Safari · FirefoxReady to connect
Trust store & statusLocal trust anchors · status if availableTrust check
HTTPS serverwww.example.comListening · 443
ClientHello

Protocol sequence

Handshake steps

Step 1 / 7

Selected message

Packet & crypto inspector

CLIENT → SERVER
Step 1 · ClientHello & key share

The client offers TLS 1.3, cipher suites, SNI, ALPN, and a temporary public key share. It does not send its private key.

supported_versions: TLS 1.3
cipher_suites: TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384
server_name: www.example.com
alpn: h2, http/1.1
key_share: X25519

Key exchange & integrity

Client sends its public key share; private key material stays on the client.

Learning simulation only. Certificate values, endpoint names, and failure outcomes are examples; no certificate, OCSP responder, or live website is contacted.

When you open a secure website, your browser and the website first need to agree on how to protect their connection. They do this with a TLS handshake. The handshake happens before normal website data is sent.

People often say “SSL handshake.” SSL is an old protocol and is no longer safe to use. Modern secure websites use TLS, which replaced SSL. In everyday speech, “SSL handshake” usually means a TLS handshake.

Where the handshake fits

For a typical website, the steps are:

Find the server with DNS
        ↓
Connect to the server (usually TCP for HTTP/1.1 or HTTP/2)
        ↓
Agree on TLS settings and check the server
        ↓
Send the HTTP request and response inside TLS

HTTP/3 uses QUIC over UDP. QUIC includes TLS 1.3 in its connection setup, so it does not use the TCP steps shown above.

What the handshake needs to do

The client and server need to:

  • agree on a TLS version and supported cryptographic settings;
  • create shared keys without sending those secret keys across the network;
  • let the client check the server’s identity; and
  • confirm that the handshake messages were not changed in transit.

The common TLS 1.3 flow

This is a typical full handshake that uses a server certificate. A resumed session, a client certificate, or a request for a different key share can change the message flow.

1. The client sends ClientHello

The client offers supported TLS versions and cipher suites. It also sends a temporary key share. For a website, the message usually includes SNI (Server Name Indication), which tells a shared server which site the client wants. It can also offer application protocols such as HTTP/2 with ALPN.

2. The server sends ServerHello

The server chooses settings from the client’s offer and returns its own key share. The two sides use their private key material and the other side’s public key share to calculate matching handshake secrets. They do not send the final shared secret over the network.

3. The server proves its identity

After ServerHello, TLS 1.3 encrypts the rest of the handshake. The server sends selected extensions, its certificate chain, CertificateVerify, and Finished. The certificate chain helps the client check the server name and trust path. CertificateVerify proves that the server controls the private key for the certificate. Finished checks the handshake transcript and confirms the handshake keys.

4. The client checks the certificate and sends Finished

The client checks that the certificate covers the requested name, is within its validity dates, and chains to a trusted certificate authority. It also checks the server’s proof and Finished message. Revocation checks depend on client policy and the status information available to it.

The client then sends its own Finished message. Client certificates are optional and are used only when a service requests client authentication.

5. Both sides exchange protected data

After the handshake, the client and server use derived traffic keys to protect application data, such as an HTTPS request and response. TLS protects data between the two TLS endpoints. It does not prove that a website is honest or that its content is safe.

What changes in TLS 1.2?

TLS 1.2 has a different message flow. A typical full ECDHE handshake includes a server flight with ServerHello, a certificate, key-exchange parameters, and ServerHelloDone. The client then sends key-exchange information and Finished; the server answers with its own Finished. The exact flow depends on the selected cipher suite and authentication method.

TLS 1.3 usually completes a full handshake in one round trip. A typical TLS 1.2 full handshake usually takes two. Both versions can be resumed, which changes the flow. TLS 1.3 also encrypts handshake messages after ServerHello and removes older key-exchange options.

A simple example

Imagine that you open https://shop.example:

  1. Your browser finds the server address and connects to it.
  2. Your browser offers TLS settings and a temporary key share.
  3. The server chooses settings and sends its certificate and proof.
  4. Your browser checks the server name and certificate trust.
  5. Both sides confirm the handshake and protect the website traffic.

If the name is wrong, the certificate is not trusted, or the client and server cannot agree on settings, the connection can stop before the page loads.

Continue learning

Common questions about SSL/TLS handshakes

Is an SSL handshake different from a TLS handshake?

People often use “SSL handshake” as an older name. Modern secure website connections use TLS; SSL should not be enabled.

Does the certificate contain the secret session key?

No. The certificate helps the client check the server identity and its proof. The client and server derive separate traffic keys for the connection.

Does TLS hide the website name?

Often, the SNI name is visible in the ClientHello. Encrypted Client Hello can protect it when both the client and server support and use it.

Sources and further reading

Pass it along

Found this useful? Share it.

Choose a platform or copy the direct link.

LinkedInXFacebook

Continue reading

Reader signal

Was this useful?

Your feedback helps shape the next field note and lab.

… views

Views count when this page opens. You can change or remove your vote during this tab session.