NETWORKING / A CONCEPT NOTE
TLS
how encryption happens before the lock icon appears
Overview · mechanism
pitfall · examples
01 / THE SHORT VERSION
The idea in a few sentences.
A handshake where the client and server agree on a cipher, exchange keys, and verify identity via a certificate chain. After that, every byte is encrypted with a session key only they know.
02 / FOLLOW THE MECHANISM
How a TLS handshake flows
Client
sends a
ClientHellolisting supported cipher suites and TLS versions.Server
responds with its chosen cipher, a session ID, and its certificate chain.
Client
validates the certificate against trusted CAs, then generates a
pre-master secretencrypted with the server's public key.Both
derive the same session keys from the pre-master secret and switch to encrypted communication.
04 / COMMAND NOTES
Read the command, then the result.
Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.
inspect the full certificate chain
openssl s_client -connect supraj.dev:443 -showcertswatch every TLS handshake step
curl -vI https://supraj.dev05 / CHECK YOURSELF
Could you explain TLS to a teammate?
Try it out loud in two sentences: what it is, and the one detail that changes the picture. If you stall, the gap is the part to reread.
Up next in NetworkingHTTPthe protocol the web speaks