Part II β The Shield Β· Lesson 3.6
Secure Communication (HTTPS)
In one lineTLS gives you three things at once: encryption, integrity, and proof of who you're talking to.
Where you've seen itPublic wifi that injects a banner ad into a page β possible only because that page travelled as plain HTTP.
Diagram
How it works
- Client and server agree on a cipher and exchange key material in one round trip.
- The certificate proves the server controls the domain; the browser validates the chain to a trusted root.
- Session keys encrypt everything after the handshake; forward secrecy means a later key compromise can't decrypt past traffic.
- HSTS removes the plaintext first hop on subsequent visits; the preload list removes it even on the first.
- Mark cookies
Secureso they never travel over HTTP at all.
Trade-offs
| Concern | Reality |
|---|---|
| "TLS is slow" | TLS 1.3 is 1 RTT, 0 on resume; HTTP/2 and /3 require it |
| Mixed content | One http:// subresource downgrades the whole page's trust |
| Certificate expiry | The most common self-inflicted outage β automate renewal |
| HSTS preload | Effectively permanent; be certain before submitting |
Interview angle
"Site is HTTPS. Is the data safe?"
- In transit, yes: encrypted, tamper-evident, and the server's identity is verified.
- Not at rest, not in the browser, and not against XSS β TLS protects the pipe, not the endpoints.
- Add HSTS for the first-request gap,
Securecookies, and eliminate mixed content.
Recap
- Encryption, integrity, identity β three guarantees from one protocol.
- HSTS closes the plaintext gap that a redirect alone leaves open.
- HTTPS protects the wire; it says nothing about what either end does with the data.