Reference notes.

TLS (Transport Layer Security) encrypts communication between two parties, providing confidentiality (encryption), authentication (certificates), and integrity (tamper detection). It’s the “S” in HTTPS.

TLS 1.3 vs 1.2

TLS 1.3 (originally RFC 8446 in 2018; updated by RFC 9846 in July 2026) is a major simplification over TLS 1.2.

AspectTLS 1.2TLS 1.3
Handshake round trips2-RTT1-RTT (0-RTT resumption)
Cipher suitesMany (including weak ones)5 strong suites only
Key exchangeRSA, DHE, ECDHE, PSKECDHE, DHE, PSK, PQ hybrid KEMs (forward secrecy by default)
Removed—RSA key exchange, RC4, DES, 3DES, MD5, SHA-1, CBC mode, static DH, compression
EncryptionAfter handshakeAfter ServerHello (ServerHello is plaintext; starts with EncryptedExtensions)

TLS 1.0 and 1.1 are deprecated (RFC 8996). TLS 1.2 remains widely supported but 1.3 should be preferred.

The TLS 1.3 Handshake

Client                               Server
  |--- ClientHello ------------------>|    Supported versions, cipher suites,
  |    + key_share (ECDHE)            |    key share (client's DH public value)
  |                                   |
  |<-- ServerHello -------------------|    Chosen cipher suite, key share
  |    + key_share (ECDHE)            |    (server's DH public value)
  |<-- {EncryptedExtensions} ---------|    Everything encrypted from here
  |<-- {Certificate} -----------------|    Server's certificate chain
  |<-- {CertificateVerify} -----------|    Signature proving possession of key
  |<-- {Finished} --------------------|    Handshake MAC
  |                                   |
  |--- {Finished} ------------------->|    Client's handshake MAC
  |                                   |    Application data can flow

The key exchange happens in the first flight — the client speculatively sends its key share in ClientHello. This is why TLS 1.3 needs only 1 RTT (vs 2 in TLS 1.2).

0-RTT Resumption

On repeat connections, the client can send application data alongside ClientHello using a pre-shared key from a previous session. Saves one full round trip but is not replay-safe — the server cannot guarantee 0-RTT data isn’t replayed. Only safe for idempotent requests (GET, not POST).

Certificates

Certificate Chain

Root CA (self-signed, trusted by OS/browser)
  └── Intermediate CA (signed by root)
        └── Leaf certificate (signed by intermediate, for your domain)

Browsers trust ~150 root CAs pre-installed in their trust store. The server sends the leaf + intermediate(s); the client validates the chain up to a trusted root. Root certificates are never sent — they’re already trusted locally.

Certificate Contents

  • Subject — Distinguished name metadata (modern browsers ignore the legacy Common Name / CN for hostname matching)
  • Subject Alternative Names (SANs) — All domain names and IP addresses the certificate covers (modern standard, replaced CN matching)
  • Issuer — The CA that signed it
  • Validity period — Not Before / Not After
  • Public key — For key exchange or signature verification
  • Signature — CA’s signature over the certificate

Certificate Formats

FormatEncodingExtensionContains
PEMBase64 (ASCII).pem, .crt, .keyCert, key, or chain
DERBinary.der, .cerSingle cert
PKCS#12Binary.p12, .pfxCert + key bundle

PEM is the most common on Linux. PKCS#12 is common on Windows and for importing into browsers.

Let’s Encrypt and ACME

Let’s Encrypt provides free, automated certificates using the ACME protocol (RFC 8555). The client proves domain control via:

  • HTTP-01 — Place a file at http://domain/.well-known/acme-challenge/
  • DNS-01 — Create a specific DNS TXT record (supports wildcards)
  • TLS-ALPN-01 (RFC 8737) — Respond on port 443 with a special ALPN protocol (acme-tls/1) and self-signed validation certificate (works when port 80 is closed)

Under CA/B Forum Ballot SC-081v3, the maximum lifetime for publicly trusted certificates dropped to 200 days in March 2026 (stepping down to 100 days in 2027 and 47 days in 2029). Let’s Encrypt issues 90-day certificates (moving toward a 45-day default) as well as 6-day (shortlived) certificates that remove the need for revocation checking. Tools: certbot, acme.sh, Caddy (built-in ACME).

Cipher Suites

TLS 1.3 has only 5 cipher suites (all AEAD). Unlike TLS 1.2, TLS 1.3 cipher suites specify only the AEAD encryption algorithm and HKDF hash — key exchange is negotiated separately via the supported_groups and key_share extensions:

Cipher SuiteEncryptionHash (HKDF)
TLS_AES_256_GCM_SHA384AES-256-GCMSHA-384
TLS_AES_128_GCM_SHA256AES-128-GCMSHA-256
TLS_CHACHA20_POLY1305_SHA256ChaCha20-Poly1305SHA-256
TLS_AES_128_CCM_SHA256AES-128-CCMSHA-256
TLS_AES_128_CCM_8_SHA256AES-128-CCM-8SHA-256

AES-GCM is fastest on hardware with AES-NI (most modern x86 CPUs). ChaCha20-Poly1305 is faster on devices without AES hardware acceleration (mobile, IoT).

Forward Secrecy

TLS 1.3 mandates ephemeral key exchange (ECDHE, DHE, or PQ hybrid KEMs) for forward secrecy. Each connection generates a unique session key. If the server’s long-term private key is later compromised, past sessions remain protected. TLS 1.2 with RSA key exchange lacked this — one compromised key decrypts all past traffic.

Key Exchange Algorithms

  • ECDHE — Elliptic Curve Diffie-Hellman Ephemeral. Most common. Curve X25519 is the default in most implementations.
  • PQ hybrid KEMs — Combines classical ECDHE with post-quantum ML-KEM (e.g., X25519MLKEM768, now the default in modern browsers).
  • DHE — Classical Diffie-Hellman Ephemeral. Slower, larger keys. Rare in modern deployments.
  • RSA — Removed in TLS 1.3. No forward secrecy (server’s static private key decrypts all sessions).

mTLS (Mutual TLS)

Standard TLS only authenticates the server. mTLS requires both sides to present certificates. The server sends a CertificateRequest message, and the client responds with its own certificate and proof of key possession.

Use cases:

  • Service-to-service authentication in microservices (Istio, Linkerd, Cilium)
  • API authentication (replacing API keys)
  • Zero-trust networking

Certificate Revocation

When a private key is compromised, the certificate must be revoked. Live OCSP checking has largely been retired in favour of browser-aggregated CRLs and short-lived certificates:

  • Aggregated CRLs (modern default) — CAs publish partitioned CRLs, and browsers ship compact revocation filters directly to clients (Chrome CRLSets, Firefox CRLite), avoiding live lookup latency and privacy leaks.
  • Short-lived certificates — Very short validity periods (such as Let’s Encrypt’s 6-day shortlived profile) bound compromise windows without needing revocation checks.
  • CRL (Certificate Revocation List) — CA publishes a signed list of revoked certificates. Direct client downloads scale poorly, so modern browsers aggregate CRLs centrally.
  • OCSP / OCSP Stapling (legacy) — Live OCSP queried the CA in real time (adding latency and leaking browsing history); OCSP Stapling let servers attach a cached OCSP response in the handshake. Adoption remained patchy and Let’s Encrypt permanently shut down OCSP on 6 August 2025, cementing the shift to aggregated CRLs and short-lived certificates.
  • Certificate Transparency (CT) — Public, append-only logs of all issued certificates. Enables detection of mis-issued certificates. Required by Chrome, Apple/Safari, Mozilla Firefox, and Microsoft Edge for publicly trusted certificates.

Post-Quantum Cryptography

Quantum computers threaten current key exchange (ECDHE) and signatures (RSA, ECDSA). The risk: “harvest now, decrypt later” — adversaries record encrypted traffic today and decrypt it when quantum computers are available.

NIST PQC Standards (2024)

  • ML-KEM (CRYSTALS-Kyber) — Post-quantum Key Encapsulation Mechanism. FIPS 203.
  • ML-DSA (CRYSTALS-Dilithium) — Post-quantum digital signatures. FIPS 204.
  • SLH-DSA (SPHINCS+) — Hash-based signatures. FIPS 205.

Hybrid Key Exchange

The standard approach combines classical and post-quantum algorithms: X25519MLKEM768 (X25519 + ML-KEM-768). If either algorithm is broken, the other still protects the connection. Enabled by default across all major browsers — Chrome and Firefox shipped it in mid-2025, and Safari shipped X25519MLKEM768 by default in macOS 26 / iOS 26 (September 2025).

IETF Standards

Encrypted Client Hello (ECH)

In standard TLS 1.3, the ClientHello — including the Server Name Indication (SNI) hostname — is sent in plaintext, exposing which domain a client is connecting to. Encrypted Client Hello (ECH, RFC 9849, March 2026) encrypts the inner ClientHello (including the real SNI) using a public key distributed in the domain’s DNS HTTPS resource record (RFC 9460). The outer ClientHello reveals only a generic public front-end name (such as a CDN host), hiding the true destination when paired with encrypted DNS (DoH/DoT/DoQ).

Common Issues

IssueCauseFix
Certificate expiredAuto-renewal failedCheck certbot timer, use openssl x509 -enddate
Certificate mismatchWrong cert for domainCheck SANs, ensure correct cert is served
Mixed contentHTTP resources on HTTPS pageUpdate all resource URLs to HTTPS
SNI issuesOld clients, wrong server configCheck ssl_server_name / virtual host config
Weak cipherLegacy TLS 1.0/1.1 or weak suitesDisable old protocols, audit cipher config
HSTS issuesStrict-Transport-Security misconfiguredStart with short max-age, test before includeSubdomains

CLI Tools

# View certificate details
openssl s_client -connect example.com:443 -servername example.com </dev/null
 
# Check certificate expiry
openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -dates
 
# Test TLS configuration
nmap --script ssl-enum-ciphers -p 443 example.com
 
# Check certificate chain
openssl s_client -connect example.com:443 -servername example.com -showcerts </dev/null

SSL Labs Server Test is the standard tool for auditing a server’s TLS configuration.

See Also

  • HTTP — Application protocol that runs over TLS
  • DNS — HTTPS records publish ECH keys; CAA records authorise CAs
  • OSI Model — TLS operates at the boundary of Layers 5-6
  • VPNs — WireGuard/IPsec provide transport-level encryption for all traffic, not just HTTP

References