map / networking / tls
Networking · principle 4 of 6
TLS
TLS adds a handshake on top of TCP (one round trip in TLS 1.3, two in 1.2) before any application data flows.
01 · Why it’s true
TLS lets a client check it’s talking to the right server, then encrypts the traffic. The server presents a certificate, signed by a certificate authority the client already trusts, that ties a public key to the hostname.
During the handshake the two sides agree on encryption keys. TLS 1.3 needs one round trip; TLS 1.2 needs two. Resumed sessions skip some of the work, and TLS 1.3’s optional 0-RTT mode lets a client send data immediately — at the cost that this early data can be replayed by an attacker.
02 · Picture it
03 · In the interview
- Debugging certificate errors: expired, wrong hostname, or a missing intermediate certificate.
- Explaining where TLS terminates (load balancer, proxy, or app) and who can see plaintext.
- Treating certificate expiry as an operational risk to automate and monitor.
04 · Practice question
“Some API clients started failing with certificate errors, but browsers work fine. What do you check?”
A strong answer covers
- Read the exact error: expired, hostname mismatch, or unknown issuer.
- Unknown issuer on some clients only often means the server isn’t sending the full chain; browsers can often fill in a missing intermediate, many libraries can’t.
- Inspect what the server actually sends with
openssl s_client -connect host:443 -servername host -showcerts. - Check expiry for every certificate in the chain, and whether failing clients have an outdated trust store.
- Afterwards: automate renewal and alert on expiry well in advance.