HTTPS

Topics SSL/TLS · Certificates · Lock Icon · HSTS · Forged Certs
01 //

HTTPS Overview

HTTPS (Hyper Text Protocol Secure) is HTTP over SSL/TLS. All communication between your browser and a website is encrypted. HTTP sends cleartext; a network attacker can intercept passwords, cookies, and other sensitive data.

HTTP vs HTTPS
HTTP - Cleartext

User sends password; server receives it. Attacker on the link gets "helloworld" in plain view.

HTTPS - Encrypted

Same flow, but traffic is encrypted. Attacker sees only "Xu587Fyus)"-like ciphertext, not the real password.

HTTPS Benefits
  • Secure channel over an insecure network
  • Reasonable protection against man-in-the-middle attacks
  • Can provide security even when only one side (server) has a proper key

Why Not All HTTPS?

Historical Reasons

Crypto can slow web servers (if not done right). Some ad networks didn't support HTTPS. Reduced revenue for publishers.

Modern Push

Google (Aug 2014) boosts ranking of sites supporting HTTPS. Today most major sites use HTTPS by default.

Threat Model: Network Attacker

Capabilities

Controls network infrastructure (routers, DNS). Can eavesdrop, inject, block, and modify packets. Examples: wireless at a café, hotel Internet (untrusted ISP).

02 //

SSL/TLS Overview

TLS (Transport Layer Security) provides public-key cryptography. The server has a key pair (SK, PK). The browser encrypts messages with the server's public key; only the server can decrypt with its private key.

Handshake Flow
client-hello
server-hello + server-cert (PK)
key exchange (EC-DHE)
client-key-exchange
Finished

HTTP data encrypted with derived key KDF{k}.

What HTTPS Encrypts

Request URL, query parameters, headers, cookies, host addresses, port numbers, amount of transferred data, and session length - all encrypted.

03 //

Certificates

How does the browser obtain the server's public key? A Certificate Authority (CA) issues a certificate binding identity (e.g., cc.gatech.edu) to a public key. The browser trusts CAs; it verifies the cert and uses the public key.

Certificate Chain
Server Bob
(SK, PK) + proof "I am Bob"
CA
issues cert with SK_CA

Important Certificate Fields

Serial Number · Version · Signature Algorithm (e.g. SHA-1 with RSA)
Not Valid Before / Not Valid After
Public Key Info (Algorithm, curve, key bytes)
Signature (signed by CA)

Certificates on the Web

CommonName & SubjectAlternativeName

Explicit name (e.g. cc.gatech.edu) or wildcard (*.gatech.edu). * must be in leftmost component; *.a.com matches x.a.com but not y.x.a.com.

CA Ecosystem

Browsers trust many CAs: ~60 top-level, ~1200 intermediate CAs. Any compromised CA can issue certs for any domain.

04 //

The Lock Icon

The lock is intended to show: (1) identity of the page origin, (2) that contents were not viewed or modified by a network attacker. In reality, many problems weaken this assurance.

When Is the Lock Displayed?
  • All elements on the page fetched using HTTPS
  • HTTPS cert issued by a CA trusted by the browser
  • Cert is valid (e.g., not expired)
  • Domain in URL matches CommonName or SubjectAlternativeName

HTTPS Disadvantages

Mixed Content

Loading insecure (HTTP) content on a secure (HTTPS) page breaks the lock and can leak data.

Proxy Caching

Public caching cannot occur - proxies typically cannot cache HTTPS responses.

Latency

HTTPS introduces some latency (handshake, crypto). Modern TLS is optimized; impact is usually small.

Myth

You do not need to buy an SSL certificate - Let's Encrypt provides free certs. Browser caching works with HTTPS.

05 //

Problems with HTTPS

Three main problem areas: (1) upgrade from HTTP to HTTPS, (2) forged certs, (3) mixed content.

1. Upgrade: HTTP → HTTPS

SSL Strip Attack (Moxie Marlinspike '08)

Attacker sits between user and server. When user requests https://bank.com, attacker prevents the upgrade - forwards request to bank over HTTPS, receives response, then serves user over HTTP. User sees no certificate error; traffic is cleartext to the attacker.

User
Attacker
Web Server

User↔Attacker: HTTP. Attacker↔Server: HTTPS. Attacker sees everything.

2. Forged Certificates

CA Compromises

2011: Comodo, DigiNotar hacked - certs issued for Gmail, Yahoo!. 2013: TurkTrust issued cert for gmail.com. 2014: Indian NIC (intermediate CA) issued certs for Google, Yahoo!. 2015: MCS (CNNIC) issued certs for Google. Attackers can MITM with rogue certs.

MITM with Rogue Certificate

Attacker has cert for "bank.com" from a valid (compromised) CA. User connects to bank; attacker intercepts, presents rogue cert. User sees valid lock. Attacker decrypts with k1, re-encrypts with k2 to real bank. Both sides use HTTPS; attacker reads all traffic.

3. Mixed Content

Page loaded over HTTPS but includes HTTP resources (scripts, images, iframes). Browser may block or downgrade; sensitive data can leak to HTTP endpoints.

06 //

Solutions

HSTS (Strict Transport Security)

Header
Strict-Transport-Security: max-age=31536000; includeSubDomains

Header tells browser to always connect over HTTPS. Subsequent visits must use HTTPS; HTTP and self-signed certs cause errors. TOFU: Trust on First Use - first visit must be over HTTPS for header to take effect. HSTS flag is deleted when user "clears private data" (security vs. privacy tradeoff).

HPKP (Public-Key Pinning) - Deprecated

RFC 7469

Site declares which CAs can sign its cert. Browser rejects certs from other CAs on subsequent visits. Example header:

Public-Key-Pins: max-age=2592000;
pin-sha256="E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g=";
pin-sha256="LPJNul+wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ=";
report-uri="https://example.net/pkp-report"

HPKP was deprecated due to operational risks (pinning to wrong key = site unreachable).

Certificate Transparency (CT)

Transparent CAs

CAs must advertise a public log of all certs they issue. Browsers only accept certs published in a log. Companies (e.g. Google) scan logs for invalid issuance. Efficient implementation via Merkle hash trees.

07 //

Summary

HTTPS Takeaways
  • HTTPS = HTTP over TLS - encrypts all traffic; protects against passive eavesdropping
  • Certificates - bind identity to public key; CAs sign certs; compromised CA = rogue certs
  • SSL Strip - attacker prevents HTTP→HTTPS upgrade; HSTS mitigates
  • Forged certs - CA hacks and state actors have issued rogue certs; CT helps detect
  • Mixed content - serve all resources over HTTPS

Further Reading

Browser mechanism for stricter error processing. Site opts in via cookie; browser treats HTTPS errors as attacks, redirects non-HTTPS to HTTPS, terminates on TLS errors, blocks insecure embedded content.