HTTPS is the secure version of HTTP, and it works by wrapping normal HTTP traffic inside a TLS (or its predecessor SSL) encryption layer, so data exchanged between a browser and a website stays private and unmodified. In practice, HTTPS uses TLS certificates and a handshake process to establish an encrypted connection, verify the server's identity, and then transmit data securely.
Background: From HTTP to HTTPS
HTTP (Hypertext Transfer Protocol) is the foundational protocol of the web, but it sends data in plain text. That means anyone on the same network—like a coffee shop Wi-Fi user—can read passwords, credit card numbers, or personal messages if they intercept the traffic. HTTPS (Hypertext Transfer Protocol Secure) was introduced to fix this. It uses the same request-response model as HTTP but adds a cryptographic layer beneath it, originally called SSL (Secure Sockets Layer) and now its successor, TLS (Transport Layer Security).
SSL was developed by Netscape in the mid-1990s, and TLS was standardized by the IETF starting in 1999. Today, SSL is considered obsolete and insecure, but the term "SSL" is still commonly used to refer to TLS certificates. When you see a padlock icon in your browser, it means the site is using HTTPS with a valid TLS certificate.
How the TLS Handshake Works
The core of HTTPS is the TLS handshake, a series of steps that happen in milliseconds when your browser connects to a secure site. Here is the simplified sequence:
- ClientHello: Your browser sends a message listing the TLS versions and cipher suites it supports, plus a random number.
- ServerHello: The server picks the highest mutually supported TLS version and cipher suite, and sends its own random number.
- Certificate: The server sends its TLS certificate, which contains its public key and identity information.
- Verification: Your browser checks the certificate against a list of trusted Certificate Authorities (CAs). If valid, it proceeds.
- Key Exchange: The browser and server use the public key (or a separate key exchange method) to agree on a shared session key—a symmetric encryption key used for the actual data.
- Finished: Both sides send a "Finished" message encrypted with the session key, confirming the handshake succeeded.
After the handshake, all subsequent HTTP requests and responses are encrypted with symmetric encryption (like AES), which is much faster than the asymmetric encryption used during the handshake. This is why HTTPS feels seamless—the overhead is minimal on modern hardware.
What TLS Certificates Actually Do
A TLS certificate is a digital file that binds a public key to an entity (like a domain name). It contains the domain name, the public key, the issuing CA, and an expiration date. When you visit a site, the certificate proves that the server controls the private key corresponding to the public key, and that a trusted CA vouches for that identity.
Certificates come in different validation levels:
- Domain Validation (DV): Only proves you control the domain. Cheap or free (e.g., Let's Encrypt).
- Organization Validation (OV): Also verifies the organization's name and address.
- Extended Validation (EV): The highest level, requiring legal documents. Browsers used to show the company name in the address bar, but this is now less prominent.
For most sites, DV certificates are sufficient. EV certificates do not provide stronger encryption—they only add identity verification, which is rarely necessary for small businesses.
Common Problems and Misconceptions
One common misconception is that HTTPS means a site is "safe" in the sense of being trustworthy. In reality, HTTPS only protects the data in transit; it does not guarantee that the site itself is legitimate or free of malware. Phishing sites can also use HTTPS.
Another issue is mixed content: if a page loaded over HTTPS includes resources (like images or scripts) over plain HTTP, browsers will block or warn about them. This is a common problem on older sites.
Certificate errors also occur. For example, if a certificate has expired, or the domain name does not match the certificate, browsers show a warning. Users should not bypass these warnings unless they are absolutely sure, because they indicate a potential man-in-the-middle attack.
How to Choose the Right TLS Setup
For website owners, the main decisions are:
- Certificate type: DV is usually fine; OV/EV only if you need to display extra trust signals.
- Key strength: Use at least 2048-bit RSA keys, or better, ECDSA keys for faster performance.
- TLS version: Disable TLS 1.0 and 1.1 (both deprecated). Use TLS 1.2 or 1.3.
- Cipher suites: Prefer forward-secrecy ciphers like ECDHE. Avoid older ones like RC4 or 3DES.
Tools like SSL Labs' SSL Test can help you check your configuration. Most hosting providers offer free DV certificates via Let's Encrypt, so there is no cost barrier to enabling HTTPS.
HTTPS vs. VPN: What's the Difference?
Both HTTPS and VPNs encrypt data, but they work at different layers. HTTPS encrypts only the traffic between your browser and a specific website. A VPN (Virtual Private Network) encrypts all traffic between your device and a VPN server, covering every app and website. If you use HTTPS, a VPN is not needed for confidentiality on that specific site, but a VPN can hide your IP address and protect traffic to non-HTTPS sites.
In practice, you should use both: HTTPS for secure web browsing, and a VPN for privacy on untrusted networks or to access geo-restricted content.
Frequently Asked Questions
Is SSL the same as TLS?
No. SSL is the older, deprecated protocol; TLS is its successor. Modern browsers and servers use TLS 1.2 or 1.3. The term "SSL" is often used colloquially, but technically it's incorrect.
How do I know if a website uses HTTPS?
Look at the URL: if it starts with "https://" and shows a padlock icon, the connection is encrypted. If it shows "http://" or a warning, the site is not secure.
Can HTTPS be hacked?
No encryption is unbreakable in theory, but TLS with strong ciphers is extremely difficult to break. The main risks come from certificate misissuance, compromised private keys, or malware on the user's device. Also, attackers can still see the domain name you're visiting (via DNS or SNI), but not the content.
Why do some sites still use HTTP?
Some small sites may not have set up certificates due to cost or technical complexity, but free options like Let's Encrypt have made this rare. Some legacy systems or internal networks may still use HTTP for simplicity.
Does HTTPS slow down my browsing?
Modern hardware and TLS 1.3 have made the overhead negligible. The handshake adds a few milliseconds, but the encryption is fast. In many cases, HTTPS can be faster than HTTP due to HTTP/2, which requires HTTPS.
What is a man-in-the-middle attack?
It's when an attacker intercepts communication between two parties. HTTPS prevents this by encrypting data and verifying the server's identity, so an attacker cannot read or modify the traffic without being detected.