arrow_backBack to field notes
CRYPTOGRAPHY Published 8 Aug 2026

How Does TLS Actually Secure an HTTPS Connection?

A practical breakdown of the TLS handshake, certificate validation, and key exchange that make HTTPS actually secure.

People say "HTTPS means it's encrypted" and leave it there, but the interesting part is how two strangers on the internet agree on a shared secret without ever meeting, over a network full of people who could be listening. That's what TLS does, and the mechanics are worth understanding if you touch networking, web dev, or security at all.

The handshake, step by step

When your browser connects to https://example.com, here's roughly what happens (TLS 1.3, which most sites now use):

  1. ClientHello — the browser sends supported cipher suites, a random nonce, and a guess at a key share (using something like X25519 or secp256r1) for key exchange.
  2. ServerHello — the server picks a cipher suite, sends its own key share, and returns its certificate plus a signature proving it holds the private key matching that certificate.
  3. Key derivation — both sides now independently compute the same shared secret using Diffie-Hellman-style math on their key shares. Neither one ever transmits the secret itself; it's derived, not sent.
  4. Finished messages — both sides confirm the handshake wasn't tampered with by sending a MAC over the whole handshake transcript.

After that, everything is encrypted with symmetric keys derived from the shared secret, usually AES-128-GCM or ChaCha20-Poly1305. TLS 1.3 trimmed this down from TLS 1.2's two-round-trip handshake to effectively one round trip, which is a real latency win at scale.

Why the certificate matters more than the encryption

Encryption without identity verification is pointless — anyone can set up an encrypted channel, including an attacker running a man-in-the-middle. The certificate is what ties a public key to a domain name, and it's signed by a Certificate Authority (CA) like Let's Encrypt or DigiCine.

Your browser trusts a fixed list of root CAs baked into the OS or browser trust store. The server's certificate chains up through intermediate certs to one of those roots. If the chain doesn't validate, or the domain in the cert doesn't match the one you requested, you get the red warning page. That chain-of-trust model is the actual security boundary — steal a CA's signing key and you can mint valid certs for any domain, which is why CA compromises are treated as major incidents.

What symmetric vs asymmetric crypto is doing here

Asymmetric crypto (RSA or elliptic curve) is slow and expensive, so TLS only uses it during the handshake — to authenticate the server and to help establish the shared secret. Once that's done, all the actual data (HTML, JSON, whatever) is encrypted with fast symmetric ciphers. This hybrid approach is the same pattern you'll see in SSH, PGP, and most real-world crypto systems: asymmetric for identity and key exchange, symmetric for bulk data.

Forward secrecy is a related detail worth knowing: because the shared secret comes from ephemeral Diffie-Hellman key shares generated fresh per session, even if someone records your traffic and later steals the server's private key, they still can't decrypt old sessions. That property didn't exist in older RSA-only key exchange.

Checking it yourself

You don't need to trust a green padlock icon blindly. Run:

openssl s_client -connect example.com:443 -tls1_3

That shows you the negotiated cipher suite, the certificate chain, and whether the handshake actually completed. For a quicker look at what a browser sees, curl -v https://example.com prints the TLS version and cert details before the HTTP response.

You can also decrypt your own traffic in Wireshark if you export the SSLKEYLOGFILE environment variable before launching Chrome or Firefox — genuinely useful for debugging TLS issues instead of guessing.

Where this actually breaks in practice

Most real-world HTTPS failures aren't cryptographic breaks, they're operational: expired certificates, misconfigured intermediate chains, clients stuck on old TLS versions, or mixed content (an HTTPS page loading an HTTP resource). Actual protocol-level attacks against modern TLS 1.3 are rare because the spec closed off most of the padding oracle and downgrade tricks that plagued SSL 3.0 and early TLS. The weak points now are usually the endpoints — a compromised CA, a stolen private key, or a user clicking through a certificate warning they shouldn't have.

If you want to go further, Korra Studio's networking and cryptography segments cover the underlying Diffie-Hellman math and packet-level protocol analysis in more depth.

Written with AI assistance, reviewed and published by Michal Pilch (CISSP), Korra Studio.

Ready to go further?

This is one note from the Korra Studio knowledge base — the platform pairs every topic with 1-to-1 mentoring.

Get started freearrow_forward