What Is HTTPS? The Padlock in Your Browser, Explained
You are on café Wi-Fi, about to log in to your bank. The address starts with https:// and a padlock sits beside it. This lesson answers what is HTTPS: how it keeps your traffic private, how it proves which site you reached, and what its padlock and warnings mean.
What plain HTTP lacks
HTTP messages are plain text (lesson 6), and without HTTPS they cross every network between you and the server exactly as written. Anyone on the path can read them: on open café Wi-Fi, anyone nearby with a packet-capture tool, a program that records passing packets, plus whoever runs the Wi-Fi, your ISP (internet service provider) and every network on the route. Your password and cookies sit right there.
Someone on the path can also change the messages, slipping adverts or malware into a page or altering a form on its way. And plain HTTP cannot prove who answered: a fake hotspot can reply as your bank, and your browser cannot tell.
HTTPS is HTTP inside TLS
HTTPS (HTTP Secure) is the same HTTP messages carried inside a protected connection built by TLS (Transport Layer Security), usually on port 443 (lesson 2). TCP delivers the bytes, TLS protects them, and HTTP gives them meaning; with HTTP/3, QUIC takes TCP's place and builds TLS in. You may also hear SSL (Secure Sockets Layer), the name of TLS's retired predecessor. TLS adds what HTTP lacks:
- Encryption: only your browser and the server hold the keys.
- Integrity: each chunk of data carries a tamper check, so a change on the way is caught and the connection dropped.
- Server identity: the server proves, with a certificate, that it is the site in the address bar.
A certificate is a website's ID card. It names the site, holds the server's public key (lesson 7) and is signed by a certificate authority (CA), an organisation your browser trusts to check that the requester controls that domain name. Lesson 18 goes deeper.
HTTPS hides what you say, not who you talk to. In the diagram, notice what stays visible: the IP addresses, the port, how much data flows and when, and usually the site's name, which the browser sends first so the server can pick the right certificate.
The handshake in plain words
Once TCP connects to port 443, browser and server run a TLS handshake, a short scripted exchange that checks identity and sets up keys. In TLS 1.3, the newest version, it takes one round trip (lesson 5); the older TLS 1.2 needs two.
- Client hello: your browser lists the encryption methods it supports, names the site, and sends a key share, the public half of a fresh one-time key pair.
- Server hello: the server picks a method and sends its own key share. Both sides now work out the same shared secret, which never crosses the network, by a Diffie-Hellman key exchange (explained below). From here on, everything is encrypted with fast symmetric keys made from that secret.
- Certificate and signature: the server sends its certificate and signs the handshake with its private key. The browser checks that signature with the certificate's public key.
- Checks: does the name match, is today within the certificate's dates, and does it trace back to a CA the browser trusts? If not, you see a warning page.
- Encrypted HTTP: the browser sends "finished" with its first request. All HTTP now flows under those keys, usually with AES (Advanced Encryption Standard).
Step 2 is like mixing paint. Each side stirs a secret colour (its private half) into the same public colour and sends the mixture (its key share), then adds its secret colour to the mixture it receives. Both end with one colour, the shared secret; an eavesdropper sees only mixtures, which cannot be unmixed.
What the padlock means, and what it doesn't
The padlock means the connection is encrypted and the server proved it holds a valid certificate for the exact name in the address bar. Recent versions of Chrome show a neutral "tune" icon, two small sliders, in its place.
It does not mean the site is honest. For most certificates the CA checks only control of the domain name, and Let's Encrypt, a non-profit CA, issues them free, so phishing sites, fakes built to steal logins, use HTTPS too. Nor does HTTPS protect your data after it arrives: it guards the trip, not the storage.
Common certificate warnings
When a check fails, the browser shows a full-page warning instead of the site, such as Chrome's "Your connection is not private". Its error code names the failed check:
- Expired (
NET::ERR_CERT_DATE_INVALID): the site did not renew in time, or your own computer's clock is wrong. - Wrong name (
NET::ERR_CERT_COMMON_NAME_INVALID): the certificate is for another name. Often a setup mistake, but also exactly what an impostor's looks like. - Self-signed (
NET::ERR_CERT_AUTHORITY_INVALID): signed by its own creator or an untrusted CA. Normal for a test server or a home router's settings page, never for a public site.
On a public site, especially one asking for a password or payment, don't click past these: the browser can no longer tell the real server from an impostor.
Check yourself
On café Wi-Fi you log in to a site over HTTPS. What can the Wi-Fi's owner still see?
Which server you reach (its IP address and usually its name) and how much data flows, but not the pages, password or cookies, because TLS encrypts everything inside the connection.
A padlocked page at mybank-verify.example asks for your bank password. Does the padlock make it safe?
No. It proves only a private connection to whoever controls mybank-verify.example. Anyone can get a certificate for a name they own, so check the name, not the padlock.
Certificates are public. Why can't an impostor present a copy of a real site's certificate?
The handshake needs a signature made with the private key that matches the certificate. That key stays secret on the real server, so the copy fails the check.