•6 min read•Protocols & Networking
How HTTPS Works Internally
#HTTP#HTTPS#Web Security
HTTPS is not a separate protocol; it is simply HTTP layered on top of TLS.
The Stack
- IP: Routes packets from A to B.
- TCP: Ensures reliable delivery (SYN, SYN-ACK, ACK).
- TLS: Establishes a secure session.
- HTTP: Sends the actual request (GET /index.html).
The Connection Flow
- DNS Lookup: Browser resolves
google.comto an IP. - TCP Handshake: Browser connects to port 443.
- TLS Handshake: Browser and server agree on keys and verify identity.
- HTTP Request: Browser sends
GET /inside the encrypted TLS tunnel. - HTTP Response: Server sends HTML inside the tunnel.
Why Certificates Matter
Without a certificate signed by a trusted Certificate Authority (CA), you have encryption but no authentication. You could be talking securely to an attacker (Man-in-the-Middle).
Self-Signed Certs
This is why self-signed certificates trigger browser warnings. The browser trusts the encryption math, but it doesn't trust who is on the other end.