0Pricing
Cloud & IT Cert Prep · Lesson

TLS Versions, Cipher Suites, and Perfect Forward Secrecy

Configure TLS 1.2/1.3, select strong cipher suites, and enable perfect forward secrecy to ensure that captured traffic cannot be decrypted retroactively.

TLS Versions, Cipher Suites, and Perfect Forward Secrecy is a free Cloud & IT Cert Prep lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cloud & IT Cert Prep learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

TLS Protocol Overview

TLS (Transport Layer Security) is the cryptographic protocol that secures the majority of internet communications — HTTPS, SMTPS, IMAPS, LDAPS, and VPNs all rely on TLS. TLS provides three security properties: confidentiality (encryption prevents eavesdropping), integrity (MAC prevents tampering), and authentication (certificates verify server identity). TLS evolved from SSL (Secure Sockets Layer), which is now deprecated. The current versions are TLS 1.2 (widely deployed) and TLS 1.3 (faster and more secure, recommended for all new deployments).

TLS Version History and Deprecations

TLS has gone through several versions, with older ones containing critical vulnerabilities. SSL 2.0/3.0: deprecated, vulnerable to POODLE, DROWN attacks. TLS 1.0: deprecated by NIST and PCI-DSS in 2020 (vulnerable to BEAST, POODLE on block ciphers). TLS 1.1: deprecated alongside TLS 1.0. TLS 1.2: current minimum standard; secure when properly configured with strong cipher suites. TLS 1.3: released 2018; removes all weak algorithms, mandatory forward secrecy, significantly faster handshake (1-RTT instead of 2-RTT), and prevents downgrade attacks. PCI-DSS 4.0 requires TLS 1.2 minimum, recommends 1.3.

# TLS version timeline
SSL 2.0   1995  DEPRECATED (DROWN)
SSL 3.0   1996  DEPRECATED (POODLE)
TLS 1.0   1999  DEPRECATED 2020 (BEAST, POODLE)
TLS 1.1   2006  DEPRECATED 2020 (no improvements over 1.0)
TLS 1.2   2008  MINIMUM STANDARD (strong ciphers required)
TLS 1.3   2018  RECOMMENDED (mandatory PFS, faster, secure)

# Check which TLS versions a server supports
nmap --script ssl-enum-ciphers -p 443 example.com
# Or:
openssl s_client -connect example.com:443 -tls1_2
openssl s_client -connect example.com:443 -tls1_3

Cipher Suites

A cipher suite is a set of cryptographic algorithms used together in a TLS session. Each cipher suite specifies: a key exchange algorithm (how session keys are established), an authentication algorithm (how the server is verified), a bulk encryption algorithm (what encrypts the data), and a message authentication code (MAC) algorithm (how integrity is verified). The client and server negotiate which cipher suite to use during the TLS handshake — the server selects the strongest suite that both parties support.

# TLS cipher suite naming format (TLS 1.2)
# TLS_[KeyExchange]_WITH_[Cipher]_[MAC]
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
  ECDHE     = Elliptic Curve Diffie-Hellman Ephemeral
  RSA       = Server certificate authentication
  AES_256_GCM = 256-bit AES in Galois/Counter Mode
  SHA384    = HMAC with SHA-384 for integrity

# TLS 1.3 simplified format (fewer components)
TLS_AES_256_GCM_SHA384
TLS_CHACHA20_POLY1305_SHA256
TLS_AES_128_GCM_SHA256

Key Exchange Algorithms

The key exchange phase establishes the session key without transmitting it. RSA key exchange (TLS 1.2): the client encrypts a premaster secret with the server's public key — if the private key is later compromised, all past sessions can be decrypted. DHE (Diffie-Hellman Ephemeral): generates a new key pair for each session; provides forward secrecy but is slow. ECDHE (Elliptic Curve DHE): achieves the same forward secrecy as DHE but with smaller key sizes and better performance — this is the preferred key exchange in both TLS 1.2 and TLS 1.3. TLS 1.3 mandates ECDHE or DHE, removing RSA key exchange entirely.

Perfect Forward Secrecy (PFS)

Perfect Forward Secrecy (PFS) ensures that even if the server's long-term private key is later compromised, past recorded sessions cannot be decrypted. PFS is achieved by using ephemeral key exchange (ECDHE or DHE) where a fresh temporary key pair is generated for each session and discarded after use. Without PFS (RSA key exchange), an attacker can record all encrypted TLS sessions today, then decrypt them retroactively when they eventually obtain the private key. The NSA's 'collect now, decrypt later' surveillance strategy assumes targets will eventually upgrade to stronger keys or quantum computers will break current ones.

# Cipher suites WITH perfect forward secrecy
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384     # Good
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256   # Good
TLS_DHE_RSA_WITH_AES_256_CBC_SHA256        # OK (slower)

# Cipher suites WITHOUT perfect forward secrecy
TLS_RSA_WITH_AES_256_CBC_SHA256  # NO PFS - avoid
TLS_RSA_WITH_3DES_EDE_CBC_SHA    # NO PFS + weak

# Key: look for ECDHE or DHE prefix
# RSA alone as key exchange = no forward secrecy

Weak Cipher Algorithms to Avoid

Several legacy cipher components are cryptographically broken and must be disabled. NULL ciphers: no encryption at all. Export-grade ciphers (FREAK attack): deliberately weakened to comply with 1990s US export regulations. RC4: stream cipher with statistical biases exploited in attacks. DES and 3DES: block ciphers with too-small block sizes (SWEET32 attack) or insufficient key lengths. MD5 and SHA-1 for MACs: collision vulnerabilities. Anonymous ciphers (aNULL): no server authentication. Modern TLS configurations should only allow AES-GCM, ChaCha20-Poly1305, AES-CCM as bulk ciphers.

# nginx: disable weak ciphers, enforce strong only
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:
             ECDHE-RSA-AES256-GCM-SHA384:
             ECDHE-ECDSA-CHACHA20-POLY1305:
             ECDHE-RSA-CHACHA20-POLY1305:
             ECDHE-ECDSA-AES128-GCM-SHA256:
             ECDHE-RSA-AES128-GCM-SHA256';
ssl_prefer_server_ciphers on;

# Explicitly disable weak ciphers in Apache
SSLCipherSuite 'HIGH:!aNULL:!MD5:!3DES:!RC4:!EXPORT'

TLS 1.3 Improvements

TLS 1.3 makes several significant security improvements over 1.2. Mandatory PFS: RSA key exchange is removed — all sessions use ECDHE or DHE. Fewer cipher suites: only 5 AEAD cipher suites are permitted; no weak cipher negotiation is possible. Faster handshake: 1 round-trip (1-RTT) vs 2-RTT in TLS 1.2, and 0-RTT for session resumption (though 0-RTT has replay attack considerations). Encrypted handshake: the server certificate is encrypted in the handshake, preventing passive observers from identifying which certificate (and therefore which website) the client is connecting to.

# TLS 1.3 handshake (simplified)
Client -> Server: ClientHello (supported ciphers, key shares)
Server -> Client: ServerHello (chosen cipher, key share)
                  {EncryptedExtensions}
                  {Certificate}
                  {CertificateVerify}
                  {Finished}
Client -> Server: {Finished}

# Both sides now have session keys
# Total: 1 round-trip before application data
# (TLS 1.2 required 2 round trips)

# Note: {} = encrypted (cert is hidden from observers)

Downgrade Attacks and POODLE

Downgrade attacks trick a TLS server and client into using an older, weaker TLS version or cipher suite than both support. POODLE (Padding Oracle On Downgraded Legacy Encryption) exploited the fact that TLS implementations would fall back to SSL 3.0 on connection errors. The mitigation was disabling SSL 3.0. FREAK and Logjam exploited export-grade ciphers. TLS_FALLBACK_SCSV is a pseudo-cipher suite that clients include to signal 'this is not my preferred version' — if a server sees it and supports a higher version, it aborts the downgrade attempt.

Certificate Verification and Pinning

TLS server authentication relies on the client verifying the server's certificate chain back to a trusted root CA. Critical checks: expiry (certificate must be within validity period), revocation (CRL or OCSP check confirms cert is not revoked), hostname (SAN or CN must match the domain being connected to), and signature chain (intermediate CA and root CA signatures are valid). Certificate Transparency (CT) requires all publicly trusted certificates to be logged in append-only CT logs, enabling detection of mis-issued certificates within minutes of issuance.

# Check TLS certificate details
openssl s_client -connect example.com:443 \
  -showcerts 2>/dev/null | openssl x509 -noout \
  -text | grep -E 'Subject:|Issuer:|Not After:|SAN'

# Verify certificate chain
openssl verify -CAfile /etc/ssl/certs/ca-certificates.crt \
  server.crt

# Check OCSP status
openssl ocsp -issuer intermediate.crt \
  -cert server.crt \
  -url http://ocsp.ca.example.com \
  -text -noverify

SSL Labs and Configuration Testing

Qualys SSL Labs (ssllabs.com/ssltest) is the gold-standard tool for evaluating a web server's TLS configuration. It grades servers from A+ (excellent) through F (critical issues) based on: supported TLS versions, cipher suite strength, certificate validity, HSTS configuration, forward secrecy support, and resistance to known attacks. An A+ rating requires: TLS 1.2+ only, all ECDHE ciphers, valid certificate, HSTS with preload. Organizations should run SSL Labs tests after initial configuration and again after any changes to the TLS stack. Many compliance frameworks (PCI-DSS) require periodic TLS configuration assessments.

TLS Certificate Management Best Practices

Expired TLS certificates cause outages and user trust warnings that attackers exploit. Certificate lifecycle management involves: tracking all certificates in a certificate inventory, configuring expiry alerts at least 30 days before expiration, automating renewal with ACME protocol (Let's Encrypt, Certbot), using short certificate lifetimes (90 days for public certificates) to reduce the window of risk from compromise, and using wildcard certificates carefully (*.example.com) since a compromised wildcard certificate affects all subdomains. Certificate management platforms (Venafi, DigiCert CertCentral) automate discovery and lifecycle across large certificate inventories.

# Auto-renew Let's Encrypt cert with Certbot
# Install Certbot
apt install certbot python3-certbot-nginx

# Issue certificate
certbot --nginx -d example.com -d www.example.com

# Certbot auto-renewal (runs twice daily via systemd timer)
systemctl status certbot.timer

# Test renewal without actually renewing
certbot renew --dry-run

# Verify cert expiry date
openssl x509 -enddate -noout -in /etc/ssl/certs/example.crt
# Output: notAfter=Feb 20 12:00:00 2025 GMT

Quick Check

Test your understanding of CompTIA Security+ (SY0-701) concepts from this lesson.

Lesson Recap

In this lesson you learned: TLS 1.0/1.1 are deprecated and TLS 1.2 is the minimum standard while TLS 1.3 is preferred with mandatory PFS and encrypted handshakes, cipher suites specify key exchange (prefer ECDHE), bulk encryption (AES-GCM, ChaCha20), and MAC algorithms, and Perfect Forward Secrecy requires ephemeral (DHE/ECDHE) key exchange so that past sessions cannot be decrypted even after key compromise. Next up we explore secure DNS: DNSSEC and DNS over HTTPS.

Frequently asked questions

Is the “TLS Versions, Cipher Suites, and Perfect Forward Secrecy” lesson free?

Yes — the full text of “TLS Versions, Cipher Suites, and Perfect Forward Secrecy” is free to read here on the web, and the Cloud & IT Cert Prep course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cloud & IT Cert Prep course, upgrade to CoddyKit PRO.

What will I learn in “TLS Versions, Cipher Suites, and Perfect Forward Secrecy”?

Configure TLS 1.2/1.3, select strong cipher suites, and enable perfect forward secrecy to ensure that captured traffic cannot be decrypted retroactively. You practise Cloud & IT Cert Prep with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Cloud & IT Cert Prep?

No prior experience is required. Cloud & IT Cert Prep on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “TLS Versions, Cipher Suites, and Perfect Forward Secrecy” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Cloud & IT Cert Prep lesson?

Yes. Every Cloud & IT Cert Prep lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Replacing Insecure Protocols: Telnet vs SSH, FTP vs SFTP
  2. TLS Versions, Cipher Suites, and Perfect Forward Secrecy
  3. Secure DNS: DNSSEC and DNS over HTTPS (DoH)
  4. IPsec, VPN Protocols, and Remote Access Security
← Back to Cloud & IT Cert Prep