Public Key Infrastructure ยท 4.4
๐ TLS & HTTPS
How PKI secures every connection to every websiteโฑ ~3 min
TLS (Transport Layer Security) is the protocol that secures HTTPS, IMAPS, SMTPS, and most other internet traffic. It uses PKI for authentication and asymmetric key exchange, then switches to symmetric AES for the actual data. The 's' in https, the padlock in your browser โ that's TLS.
TLS 1.3 Handshake (Simplified)
- 1.ClientHello โ client sends: TLS version, list of supported cipher suites, random value, ECDH public key
- 2.ServerHello โ server sends: chosen cipher suite, random value, ECDH public key, and its certificate
- 3.Certificate Verification โ client verifies the certificate chain up to a trusted root CA
- 4.Key Derivation โ both sides compute the same shared secret via ECDHE; derive session keys
- 5.Finished โ both send an encrypted 'Finished' message using the derived keys; handshake authenticated
- 6.Application Data โ all traffic now encrypted with AES-GCM or ChaCha20-Poly1305
โ
FactTLS 1.3 reduced the handshake from 2 round-trips (TLS 1.2) to 1 round-trip โ cutting latency in half. It also supports 0-RTT resumption for returning visitors: a returning client can send application data in the very first message, before the server responds.
TLS Versions โ What to Use
| Version | Year | Status | Notes |
|---|---|---|---|
| SSL 3.0 | 1996 | โ Disabled | POODLE attack โ never enable |
| TLS 1.0 | 1999 | โ Deprecated | BEAST, CRIME attacks; disabled by all major browsers |
| TLS 1.1 | 2006 | โ Deprecated | Similar vulnerabilities; disabled since 2021 |
| TLS 1.2 | 2008 | โ Acceptable | Still widely used; requires careful cipher selection |
| TLS 1.3 | 2018 | โโ Recommended | Mandatory Forward Secrecy; removed all weak options; use this |
๐ SecurityConfigure your web server to support only TLS 1.2 and TLS 1.3. Disable TLS 1.0, TLS 1.1, and all SSL versions. Also disable weak cipher suites: RC4, DES, 3DES, export-grade ciphers, MD5, SHA-1 in certificates. Use Mozilla's TLS configuration generator (ssl-config.mozilla.org) for nginx/Apache configs.
HSTS โ HTTP Strict Transport Security
๐ก TipThe HSTS header tells browsers to never connect to your domain over plain HTTP โ even if the user types http:// โ for the specified duration. This prevents SSL stripping attacks. Add:
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload and submit your domain to the HSTS preload list (hstspreload.org) to have it hardcoded into all browsers.๐ง Quick Checkfirst try = +5 XP
In TLS 1.3, what encrypts the actual web traffic after the handshake?
๐ฎ Practice what you learned
โญ 0 XP๐ฅ 0 days