Skip to content
Commitwise
Menu
Networking

TLS and HTTPS

What TLS protects and how. Covers encryption, integrity and authentication, the TLS 1.3 handshake, forward secrecy, what an eavesdropper still sees, certificates and the chain of trust, the missing intermediate that works on your Mac and fails on Android, expiry and shorter lifetimes, certificate pinning, HSTS, mutual TLS, and where to terminate TLS.

intermediate

The core idea with one simple example.Step by step, with more examples and exercises.A cheat sheet: key APIs, gotchas and trade-offs.Internals, trade-offs and production pitfalls.

Without encryption, every router, Wi‑Fi hotspot and provider between an app and its server can read and change the traffic: passwords, tokens, messages, the price in a checkout response. TLS (Transport Layer Security) prevents that, and HTTPS is simply HTTP sent through a TLS connection.

Most of the time TLS is invisible: the URL says https:// and the library does the rest. It becomes visible when it fails: an expired certificate takes down the API at midnight, an app works on iPhone and fails on Android, a debugging proxy can’t see the app’s traffic. This lesson explains enough of how TLS works to handle those, and to answer the interview classic “what happens in a TLS handshake?”. It builds on TCP vs UDP and HTTP/1.1, HTTP/2 and HTTP/3.

New to some of these? Open what you need, or skip ahead.

Basics:Encryption and keys

Encryption scrambles data with a key so only someone with the right key can unscramble it. With a symmetric key, the same secret locks and unlocks, which is fast. With an asymmetric key pair, a public key (shared with everyone) and a private key (kept secret) work together: data locked with one can only be unlocked with the other, and the private key can sign data so anyone with the public key can check who signed it.

Basics:TCP connection

Before TLS starts, client and server open a TCP connection with a handshake that costs one round trip. TLS then runs its own handshake over that connection. See TCP vs UDP.

Part Not started

What TLS does, and the handshake

TLSTLSTransport Layer Security: the protocol that encrypts and authenticates connections, as in HTTPS.Open in glossary → gives a connection three guarantees:

  • Confidentiality: the data is encrypted; anyone in between sees random-looking bytes.
  • Integrity: if someone changes even one bit on the way, the receiver notices and drops the connection.
  • Authentication: the client knows it’s really talking to shop.example, not to a fake server on the café Wi‑Fi. The server proves this with a certificate.

The last one is easy to forget and the most important. Encryption alone is useless if you’ve encrypted your password for an attacker.

Setting up these guarantees is the TLS handshake. In TLS 1.3, the current version, it takes one round trip:

client                                             server
  | -- ClientHello: TLS versions, ciphers,             |
  |    hostname (SNI), my key share -------------->    |
  |                                                    |
  | <-- ServerHello: chosen cipher, its key share,     |
  |     certificate, signature proving it has the      |
  |     private key, Finished ------------------------ |
  |                                                    |
  | -- Finished, then the HTTP request (encrypted) --> |

The clever part is the key shares. Each side makes a temporary key pair and sends only the public half. From their own private half and the other’s public half, both sides calculate the same secret, which never travels over the network. Someone watching sees both public halves and still can’t compute it. That secret becomes the symmetric key that encrypts the rest of the connection.

The certificate and signature answer the other question: is the server whose key share I got really shop.example? Only the real server has the private key that matches the certificate, so only it can produce a valid signature over the handshake.

  • TLS 1.3 (2018): 1-RTT handshake, 0-RTT resumption (replayable), only AEAD ciphers (AES-GCM, ChaCha20-Poly1305), only ephemeral (EC)DHE key exchange, so forward secrecy is mandatory; encrypted certificate; removed RSA key transport, CBC modes, compression and renegotiation. TLS 1.2 still needs 2 RTT and safe configuration; 1.0 and 1.1 are deprecated (RFC 8996).
  • Key exchange: X25519 is the common default; browsers and Cloudflare now use the hybrid post-quantum X25519MLKEM768 by default, protecting today’s traffic from later decryption by quantum computers (“harvest now, decrypt later”). Larger key shares can push the ClientHello over one packet, which exposed broken middleboxes.
  • Visible to observers: IP addresses and ports, the SNI hostname in the ClientHello (unless Encrypted Client Hello is used, still limited), DNS queries unless DoH/DoT, packet sizes and timing (enough to fingerprint pages or apps). Not visible: path, query string, headers, cookies, bodies.
  • ALPN in the same handshake negotiates h2 or http/1.1; QUIC carries TLS 1.3 inside its own handshake.
  • Session resumption with tickets skips the certificate and signature on reconnects, saving CPU and bytes; ticket keys must rotate, or a stolen ticket key undermines forward secrecy for resumed sessions.
  • Costs: handshake CPU (signatures, mostly ECDSA now) is small on modern hardware; the real cost is the round trip, which connection reuse removes.

Predict the output

A user on public café Wi-Fi opens the URL below over HTTPS. What can the café's network owner see?

https://shop.example/account/reset?token=8f2c91d4e7
# the handshake result: version, cipher, certificate chain, verification
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
  | grep -E 'Protocol|Cipher is|^ [0-9] s:|Verify return'
#  0 s:CN=example.com
#  1 s:C=US, O=SSL Corporation, CN=Cloudflare TLS Issuing ECC CA 3
#  ...
# New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
# Verify return code: 0 (ok)

# how long the TLS handshake took, after the TCP connect
curl -s -o /dev/null -w 'tcp %{time_connect}  tls done %{time_appconnect}\n' https://example.com/

# is TLS 1.0 still accepted? (it shouldn't be)
openssl s_client -connect shop.example:443 -tls1 </dev/null

Worked example: a TLS 1.3 handshake, step by step

The app connects to https://api.shop.example. The TCP connection is already open.

  1. ClientHello. The app sends the TLS versions and ciphers it supports, the name api.shop.example (so a server hosting many sites knows which certificate to use), and the public half of a fresh temporary key pair.
  2. ServerHello. The server picks TLS 1.3 and a cipher, and sends the public half of its own temporary key pair. From this moment both sides can compute the shared secret, so everything after this is encrypted.
  3. Certificate. The server sends its certificate: “this public key belongs to api.shop.example”, signed by a certificate authority, plus the intermediate certificates that connect it to an authority the phone trusts.
  4. CertificateVerify. The server signs a summary of the whole handshake so far with its private key. Only the real owner of the certificate can do this, and the signature also proves that nobody tampered with the earlier messages.
  5. Checks on the phone. Is the certificate valid today? Is it for api.shop.example? Does the chain lead to a trusted root? Does the signature match? If any answer is no, the connection is closed with an error.
  6. Finished. Both sides send a short message confirming they computed the same keys. The app sends GET /orders, encrypted. One round trip after the TCP connection, data is flowing.
Deep diveForward secrecy: what a stolen private key revealsInterview favorite

“An attacker stole our server’s private key. Can they decrypt traffic they recorded last year?” With modern TLS, no, and the reason is a design change worth explaining.

In old TLS with RSA key transport, the client picked the session secret, encrypted it with the server’s public RSA key and sent it. Anyone holding the private key could decrypt that message from a recording and, with it, the whole session. Every past session recorded by an attacker became readable the day the key leaked.

With ephemeral Diffie-Hellman (ECDHE), each connection uses fresh temporary key pairs, discarded after the handshake. The server’s long-term private key only signs the handshake; it never protects the session secret. A stolen key lets the attacker impersonate the server from now on (until the certificate is revoked and replaced), but it can’t unlock recordings. That’s forward secrecy, and TLS 1.3 makes it mandatory.

Caveats a senior should add: session ticket keys that are never rotated recreate the problem for resumed sessions; 0-RTT early data has weaker guarantees; and a TLS-terminating proxy or a logging system that stores decrypted traffic is a bigger exposure than the key. After a key compromise: revoke the certificate, issue a new key (not just a new certificate), rotate ticket keys, and check what the attacker could reach while impersonating you.

  • TLS = confidentiality, integrity, authentication. 1.3: 1 RTT, AEAD only, ECDHE only (forward secrecy), 0-RTT replayable; 1.0/1.1 deprecated.
  • Key shares give both sides a secret that never travels; the certificate signature authenticates the server.
  • Visible: IPs, SNI hostname (unless ECH), DNS unless encrypted, sizes and timing. Hidden: path, query, headers, body.
  • Hybrid post-quantum key exchange (X25519MLKEM768) is the browser default; rotate session ticket keys.
echo | openssl s_client -connect host:443 -servername host 2>/dev/null | grep -E 'Protocol|Cipher is|Verify'
curl -s -o /dev/null -w 'tcp %{time_connect} tls %{time_appconnect}\n' https://host/

Check this part

  1. Which TLS guarantee stops a fake server on public Wi-Fi from pretending to be your bank?

  2. How many round trips does a TLS 1.3 handshake add?

  3. An attacker gets the server's private key. With TLS 1.3, can they decrypt recorded past sessions?

  4. Which of these is visible to a network observer of an HTTPS request without ECH?

TLS gives a connection three properties: encryption (nobody else can read it), integrity (nobody can change it unnoticed) and authentication (the server proves its identity with a certificate). The TLS 1.3 handshake takes one round trip: the client sends a key share, the server answers with its own, its certificate and a signature, and both derive session keys. Observers still see IPs, the hostname and traffic sizes.

Part Not started

Certificates and the chain of trust

A certificate is a small signed document that says: “the public key in here belongs to shop.example and www.shop.example, valid from 1 November 2026 to 30 January 2027”. The names it covers are listed in its Subject Alternative Names (SAN). A certificate for *.shop.example (a wildcard) covers one level of subdomains: api.shop.example, but not shop.example itself or v2.api.shop.example.

Anyone can make a certificate, so the question is who signed it. A certificate authorityCertificate authorityAn organization that verifies domain control and signs certificates that devices trust.Open in glossary → (CA), like Let’s Encrypt, DigiCert or Google Trust Services, checks that you control the domain (by serving a file or adding a DNS record) and then signs your certificate.

Your phone and computer come with a list of about 150 trusted root CAs. Roots don’t sign websites directly; they sign intermediate CAs, which sign the site’s certificate (the leaf). So the client checks a chain:

leaf:          CN=example.com                         (sent by the server)
intermediate:  Cloudflare TLS Issuing ECC CA 3         (sent by the server)
intermediate:  SSL.com TLS Transit ECC CA R2           (sent by the server)
root:          SSL.com TLS ECC Root CA 2022            (already on the device)

Each certificate’s signature is checked with the public key of the one above it, up to a root the device already trusts. The server must send the leaf and the intermediates; the root is on the device.

Certificates expire. Let’s Encrypt certificates last 90 days, and the industry maximum is shrinking step by step (to 200 days in 2026 and 47 days by 2029). Renewing by hand doesn’t work at that pace: certificates are renewed automatically by tools like certbot, by the hosting platform, or by the cloud load balancer, using the ACME protocol.

  • Validation: chain building to a trusted root, signatures, validity dates (device clocks that are wrong cause “certificate not yet valid”), hostname against SAN (the CN field is ignored by modern clients), key usage, and revocation where checked.
  • Root stores differ: Apple, Android (per OS version, updatable through Google Play system updates on newer versions), Mozilla (used by many Linux distributions and Node.js’s bundled store), Java’s cacerts and Windows. Old Android devices that lack a new root fail when a CA switches chains; Let’s Encrypt’s 2024 chain change was the recent example.
  • Missing intermediates: browsers and Apple’s networking stack can fetch them via the AIA URL or use cached ones, so the site “works”; OpenSSL, Java, Python, Node.js and Android apps don’t. Always serve the full chain (fullchain.pem), and test with openssl s_client, not a browser.
  • Lifetimes: CA/Browser Forum ballot SC-081 cuts the maximum from 398 days to 200 (March 2026), 100 (March 2027) and 47 days (March 2029), and domain validation reuse shrinks too. Automate with ACME (certbot, cert-manager in Kubernetes, managed certificates), monitor expiry anyway, and alert well before.
  • Revocation is weak in practice: OCSP is being retired (Let’s Encrypt ended it in 2025), CRLs are downloaded in compressed form by browsers (CRLite, CRLSets), and most apps don’t check at all. Short lifetimes are the industry’s real answer.
  • Certificate Transparency: every publicly trusted certificate is logged; browsers require proof (SCTs). Monitor CT logs (crt.sh) for certificates issued for your domains that you didn’t request. CAA records restrict which CAs may issue.

Predict the output

incomplete-chain.badssl.com sends only its leaf certificate, without the intermediate. The same URL is fetched by curl on macOS, by openssl s_client, by Python and by Node.js. What happens?

curl -sS -o /dev/null -w '%{http_code}\n' https://incomplete-chain.badssl.com/          # macOS curl
echo | openssl s_client -connect incomplete-chain.badssl.com:443 \
  -servername incomplete-chain.badssl.com 2>/dev/null | grep 'Verify return'
python3 -c "import urllib.request as u; u.urlopen('https://incomplete-chain.badssl.com/')"
node -e "fetch('https://incomplete-chain.badssl.com/').then(r => console.log(r.status))"
# who issued it, for which names, until when
echo | openssl s_client -connect shop.example:443 -servername shop.example 2>/dev/null \
  | openssl x509 -noout -issuer -ext subjectAltName -enddate

# days until expiry, for a monitoring check (exit code 1 if it expires within 14 days)
echo | openssl s_client -connect shop.example:443 -servername shop.example 2>/dev/null \
  | openssl x509 -noout -checkend $((14 * 24 * 3600))

# typical failures, on purpose
curl https://expired.badssl.com/       # certificate has expired
curl https://wrong.host.badssl.com/    # no alternative certificate subject name matches
curl https://self-signed.badssl.com/   # self signed certificate

# every certificate ever issued for a domain (Certificate Transparency)
open 'https://crt.sh/?q=shop.example'

Works in the browser, fails in the app

Spot the bugNGINX with a Let's Encrypt certificate

Tap the line with the bug.

server {
    listen 443 ssl;
    server_name api.shop.example;
    ssl_certificate     /etc/letsencrypt/live/api.shop.example/cert.pem;
    ssl_certificate_key /etc/letsencrypt/live/api.shop.example/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:8080;
    }
}

Deep diveCertificate pinning on mobile: when and howInterview favorite

“Should our banking app pin certificates?” PinningCertificate pinningTrusting only specific server keys for a domain, instead of any certificate a trusted authority has issued.Open in glossary → means the app accepts only specific keys for your servers, not any certificate from any trusted CA. It defends against a mis-issued or fraudulent certificate from one of ~150 CAs, and against a user (or malware, or an employer) installing a custom root to intercept traffic.

The risks are operational, and they’re why many teams decided against it:

  • Pin the public key (SPKI hash), not the certificate, so renewals with the same key keep working.
  • Always ship backup pins: a second key you’ve generated and kept offline, and ideally the intermediate CA’s key. If the only pinned key is lost or rotated, every installed app version stops working until users update, and some never do.
  • Plan rotation through app releases: add the new pin in an app version months before the server switches.
  • Prefer platform configuration: Android’s network security configNetwork Security ConfigAn Android XML file that declares which certificates the app trusts, whether cleartext is allowed, and which keys are pinned.Open in glossary → (<pin-set> with an expiration date, after which pinning switches off instead of bricking old apps) and iOS’s NSPinnedDomains in Info.plist (iOS 14+), or OkHttp’s CertificatePinner, rather than custom trust code that’s easy to get wrong.
  • Scope it to your own API domains, never to third-party SDK endpoints or CDNs you don’t control.

Without pinning, platform defaults already help: apps targeting Android 7+ don’t trust user-installed CAs unless the app opts in, and iOS App Transport SecurityApp Transport SecurityAn iOS policy that blocks plain HTTP and weak TLS for the app's network connections unless an exception is declared.Open in glossary → requires TLS 1.2+ with forward secrecy. A good answer weighs the threat (high-value targets, hostile networks) against the outage risk, and if pinning, describes backup pins, expiration and the rollout plan. Pinning also doesn’t stop someone who controls the device: they can patch the app.

  • Chain: leaf (SAN names; CN ignored), intermediates (server must send them), root (device store). Root stores differ by platform and OS version.
  • Browsers and Apple’s stack fill missing intermediates; OpenSSL, Java, Python, Node and Android don’t. Serve fullchain.pem; test with openssl s_client.
  • Max lifetime 200 days now, 47 by 2029: ACME automation plus expiry monitoring. Revocation is weak; CT logs and CAA help.
  • Pinning: SPKI hashes, backup pins, expiration, platform config, own domains only.
echo | openssl s_client -connect host:443 -servername host 2>/dev/null | openssl x509 -noout -enddate -ext subjectAltName
echo | openssl s_client -connect host:443 -servername host -showcerts 2>/dev/null | grep -c 'BEGIN CERT'   # >= 2

Check this part

  1. What must the server send besides its own (leaf) certificate?

  2. Does a certificate for *.shop.example cover shop.example?

  3. The site works in Chrome, but the Android app fails with "trust anchor not found". Most likely cause?

  4. What makes certificate pinning safe to operate?

A certificate binds a public key to hostnames and is signed by a certificate authority. Clients trust a short list of root CAs and verify a chain: leaf, intermediates, root. Servers must send the intermediates; some clients fetch missing ones, so a broken chain works in a browser and fails on Android, Java or Node. Certificates expire, and lifetimes are getting shorter, so renewal must be automatic.

Part Not started

HTTPS in practice

Today everything should be HTTPS, and platforms enforce it:

  • Browsers mark HTTP pages as “Not secure” and block mixed content: an HTTPS page that loads a script over HTTP gets the script blocked.
  • iOS apps can’t make plain HTTP requests by default (App Transport Security), and Android apps targeting Android 9 or later can’t either (cleartext traffic is disabled). Exceptions must be declared in the app’s configuration.
  • HSTSHSTSHTTP Strict Transport Security: a header that makes browsers use only HTTPS for a site.Open in glossary → (HTTP Strict Transport Security): a server sends Strict-Transport-Security: max-age=31536000; includeSubDomains, and the browser remembers for a year to never use plain HTTP for that site. Even if the user types http://, the browser switches to https:// before sending anything. That closes the gap where the very first HTTP request could be intercepted and redirected to a fake site.

On the server side, TLS often isn’t handled by the app at all. A load balancer or CDN in front holds the certificate, terminates TLS, and forwards the request to the app, either as plain HTTP inside the private network or over a new TLS connection. The app then learns the original scheme from a header like X-Forwarded-Proto: https.

To see an app’s HTTPS traffic while debugging, tools like Charles, Proxyman or mitmproxy act as a man in the middle: they present their own certificate, so the device must trust their CA. On Android, apps don’t trust user-installed CAs unless their network security config allows it for debug builds.

  • HSTS: max-age (one year or more for preload), includeSubDomains (check every subdomain serves HTTPS first, including internal ones), preload plus submission to the browser preload list, which is hard to undo. Send it only over HTTPS. HSTS doesn’t apply to apps’ own HTTP clients.
  • Redirects: HTTP to HTTPS with 301/308 for browsers; APIs should not redirect plain HTTP (a client that sent a token over HTTP has already leaked it), better to refuse or not listen on port 80 at all.
  • Termination options: at the edge (CDN or L7 load balancer: central certificates, WAF and routing, but plaintext behind it), re-encryption to the back end (TLS again, often with internal certificates), or pass-through on an L4 balancer (end-to-end, but no L7 features). Compliance regimes often require encryption inside the network too.
  • Mutual TLSMutual TLS (mTLS)TLS where the client also presents a certificate, so both sides authenticate each other.Open in glossary → (mTLS): the client also presents a certificate, so service-to-service calls are authenticated without shared secrets. Service meshes (Istio, Linkerd) issue short-lived certificates per workload (SPIFFE IDs) and rotate them automatically. mTLS for mobile clients is rare: keys on devices are hard to protect and to rotate.
  • App platform rules: iOS ATS (TLS 1.2+, forward secrecy, exceptions per domain justified at review), Android cleartextTrafficPermitted, <debug-overrides> for trusting proxy CAs only in debug builds.
  • Common production failures: expired certificates (monitoring, automation), SNI missing in old clients so the default certificate is served, clock skew on devices, TLS-inspecting corporate proxies that replace certificates (breaking pinned apps), and a certificate renewed on one load balancer but not on another.

Predict the output

A user visited https://shop.example last week, and it answered with the header below. Today they type http://shop.example in the browser on a hotel Wi-Fi. What does the browser send over the network?

Strict-Transport-Security: max-age=31536000; includeSubDomains
<!-- Android: res/xml/network_security_config.xml -->
<network-security-config>
    <base-config cleartextTrafficPermitted="false" />
    <!-- trust user-installed CAs (Charles, mitmproxy) in debug builds only -->
    <debug-overrides>
        <trust-anchors>
            <certificates src="user" />
        </trust-anchors>
    </debug-overrides>
</network-security-config>
# NGINX: TLS 1.2+ only, HSTS, and plain HTTP redirected for browsers
server {
    listen 80;
    server_name shop.example;
    return 308 https://$host$request_uri;
}
server {
    listen 443 ssl;
    http2 on;
    server_name shop.example;
    ssl_certificate     /etc/letsencrypt/live/shop.example/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/shop.example/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
}

Practice: read the error

Exerciseeasy

What went wrong?

Match each error to its most likely cause and fix:

  1. curl: (60) SSL certificate problem: certificate has expired
  2. curl: (60) SSL: no alternative certificate subject name matches target host name 'api.shop.example'
  3. Android: CertPathValidatorException: Trust anchor for certification path not found, but the site works in Chrome.
  4. iOS: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
  5. A user’s phone shows “certificate not yet valid” for every site.
›

Each message names the check that failed: the dates, the name, the chain, the app’s own rules, or the device.

SolutionTry it yourself first
  1. The certificate’s end date has passed. Renew it, then find out why automatic renewal didn’t run, and add expiry monitoring.
  2. The certificate doesn’t list api.shop.example. Maybe it’s for shop.example only, or the server sent its default certificate because the client didn’t send the hostname (SNI). Issue a certificate that includes the name, or fix the server’s per-host configuration.
  3. The intermediate certificate is missing. Chrome fetched it on its own; Android doesn’t. Serve the full chain.
  4. The app made a plain http:// request. Use https://. Only if the server truly can’t support HTTPS, add a narrow per-domain exception.
  5. The phone’s clock is wrong, set far in the past, so every certificate seems to start in the future. Fix the date and time settings.
Deep diveWhere should TLS terminate?Interview favorite

“Design TLS for a system with a CDN, a load balancer and 30 internal services.” Lay out the options with what each gives up.

  1. At the edge only: the CDN or load balancer terminates TLS and talks plain HTTP to services inside a private network. Simplest, one place for certificates, full L7 features (routing, WAF, caching). But anyone with access inside the network (a compromised pod, a misconfigured peering, a cloud employee in some threat models) can read and alter traffic, and it fails many compliance requirements (PCI DSS for card data, HIPAA guidance).
  2. Re-encrypt behind the edge: the load balancer opens new TLS connections to services, using certificates from an internal CA. Encryption in transit everywhere; the load balancer still sees plaintext, which it needs for L7 routing.
  3. Mutual TLS between services: every service has its own short-lived certificate (a service mesh’s sidecars or a library), and both sides verify each other. Adds authentication, so authorization rules can say “only checkout may call payments”. Cost: certificate issuance and rotation infrastructure, CPU, harder debugging, and the mesh as a dependency.
  4. Pass-through to the service: an L4 balancer forwards encrypted bytes and the service terminates TLS. End-to-end confidentiality from the client; no L7 features at the balancer; every service manages public certificates.

A typical modern answer: terminate public TLS at the CDN or edge load balancer with managed certificates and automatic renewal, re-encrypt to the cluster, and use mTLS inside with a mesh or SPIFFE-based identities for zero-trust service-to-service authentication; pass-through only for special cases (end-to-end encrypted payloads, client certificates that the service itself must see). Mention operations: certificate expiry monitoring at every layer, consistent TLS policies (1.2+), and that headers like X-Forwarded-Proto and X-Forwarded-For must be set by the edge and stripped from client input.

  • HSTS (max-age, includeSubDomains, preload list; first visit unprotected without preload); APIs shouldn’t redirect HTTP, refuse it.
  • Platforms block cleartext: iOS ATS, Android 9+ cleartextTrafficPermitted=false; user CAs only via debug-overrides.
  • Termination: edge only, re-encrypt, mTLS between services (mesh, short-lived SPIFFE certificates), or L4 pass-through.
  • Failures: expiry, missing SNI, clock skew, TLS-inspecting proxies vs pinning, certificates renewed on only some balancers.
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload

Check this part

  1. What does HSTS make the browser do?

  2. An iOS app request to http://api.shop.example fails by default. Why?

  3. What does mutual TLS add between services?

  4. Why shouldn't an API redirect http:// requests to https://?

HTTPS everywhere: HSTS makes browsers refuse plain HTTP for a domain, mixed content is blocked, iOS ATS and Android's cleartext rules block HTTP in apps. TLS usually terminates at a load balancer or CDN; traffic behind it is re-encrypted or protected by mutual TLS between services. Debugging HTTPS traffic needs a proxy whose CA the device trusts.

Key takeaways

  • TLS gives encryption, integrity and authentication; HTTPS is HTTP over TLS.
  • The TLS 1.3 handshake takes one round trip; both sides compute a shared secret that never travels.
  • Observers still see the server’s IP and hostname, but not the path, headers or body.
  • Certificates form a chain: leaf and intermediates from the server, root on the device. Serve the full chain.
  • Certificates expire, sooner every year: automate renewal and monitor it. HSTS and platform rules keep traffic on HTTPS.
  • Forward secrecy is mandatory in TLS 1.3; key theft enables impersonation, not decryption of recordings.
  • Root stores differ by platform; only some clients fill missing intermediates; revocation is weak, short lifetimes and CT logs compensate.
  • Pinning: SPKI hashes, backup pins, expiration, release planning.
  • Terminate at the edge, re-encrypt, mTLS inside; keep forwarding headers under the edge’s control.

Finished this page?Nice work, this page is complete!

Mark it as done to track your progress. It's saved in this browser, no account needed.

Its cards are now in your Bites review ⚡
Esc

Type to search the whole site.