HTTPS and TLS Explained
Learn what the padlock really promises, how TLS encrypts and authenticates web traffic, what it leaves exposed, and how to set it up well.
Key takeaways
- TLS provides confidentiality, integrity and server authentication for web traffic between your browser and the server.
- A certificate links a domain name to a public key, and a certificate authority vouches for that link.
- HTTPS hides page contents, full URL paths, cookies and form data, but the network can still see which servers you contact.
- A padlock says the connection is protected, and says nothing about whether the site's owner is trustworthy.
- Site owners should use modern TLS versions, automate certificate renewal and redirect all HTTP traffic to HTTPS.
HTTPS is ordinary HTTP carried inside an encrypted channel created by TLS, short for Transport Layer Security. It gives you three assurances: other parties on the network can't read the contents, they can't change them without being detected, and you are talking to a server that holds a valid certificate for the name in your address bar.
It does not promise that the site is honest or safe. A scam page can have perfectly good encryption. Knowing where the protection starts and stops is what makes the padlock useful.
What HTTPS adds to HTTP
Plain HTTP sends requests and responses as readable data. Anyone positioned along the path, such as someone on the same open Wi-Fi network or an operator of an intermediate device, could read or alter them.
HTTPS wraps the same requests and responses in TLS. The default port changes from 80 to 443, and the URL scheme becomes https://. The web application itself behaves the same.
TLS is the successor to an older protocol called SSL (Secure Sockets Layer). All SSL versions are obsolete, as are TLS 1.0 and 1.1, which RFC 8996 formally deprecated. People still say "SSL certificate," but what runs on a healthy server today is TLS 1.2 or TLS 1.3. TLS 1.3 is specified in RFC 8446.
The three guarantees
Confidentiality comes from symmetric encryption: both ends share a secret key that scrambles and unscrambles the data. It's fast enough to protect video streams and large downloads.
Integrity means every chunk of data carries a cryptographic check. If anyone flips even a bit in transit, the receiver notices and drops the connection. Modern cipher suites do encryption and integrity together.
Authentication is what stops someone from simply pretending to be your bank and encrypting a conversation with you. The server presents a certificate and proves it possesses the matching private key.
Two kinds of cryptography working together
Symmetric encryption has a chicken-and-egg problem: how do two strangers agree on a secret while others are listening? Public key cryptography solves it.
A server has a key pair. The private key stays on the server. The public key is shared freely, inside the certificate. A signature made with the private key can be checked by anyone with the public key, but only the key holder could have made it.
In a modern connection, your browser and the server also perform a key exchange, usually a form of Diffie-Hellman using elliptic curves. Each side contributes a temporary value, and both arrive at the same shared secret without ever sending it. The server signs the exchange with its long-term key, proving it's the party named in the certificate.
Because the temporary values are thrown away, someone who records your traffic and later steals the server's private key still can't decrypt it. This property is called forward secrecy, and TLS 1.3 requires ephemeral key exchange for ordinary full handshakes. Many deployments have also begun adding quantum-resistant key exchange alongside the classical kind.
The full order of messages is covered in the TLS handshake, step by step.
Certificates and trust
A certificate is a signed file that says, in effect, "this public key belongs to these domain names, until this date." The signature comes from a certificate authority (CA).
Your operating system or browser ships with a list of root certificates it trusts. A CA's root signs an intermediate certificate, which signs the server's certificate. Your browser follows that chain back to a root it already knows. How certificates and authorities work walks through the chain in detail.
For most websites, the CA only confirms that the applicant controls the domain. Some certificate types also check the organization behind it, as explained in DV, OV and EV certificates.
If any link fails, whether the date has passed, the name doesn't match or the issuer is unknown, the browser shows a warning. Those warnings deserve attention; see what certificate errors mean.
What an observer can still see
Encryption covers the contents, not the fact of communication.
The site name typically appears in a handshake field called Server Name Indication (SNI), which lets one address host many secure sites. An extension called Encrypted Client Hello can hide it, but it only works when both browser and server support it.
Your DNS queries are separate. Unless you use encrypted DNS, the network can see which names you look up. A VPN moves this visibility from your local network to the VPN provider.
TLS also ends at the server. The site operator sees everything you send, and so may services it relies on, such as a CDN that terminates the encrypted connection on its behalf. This is encryption in transit, which differs from end-to-end encryption between two people.
What the padlock does not mean
Anyone who controls a domain can get a certificate for it, including someone who registered a misleading name an hour ago. So:
- Read the domain name carefully, especially its last two parts.
- Don't treat a padlock, or its absence of warnings, as an endorsement.
- Reach important accounts through bookmarks or the official app rather than links in messages.
Many browsers have toned down or replaced the padlock icon for this reason, treating HTTPS as the normal state and calling out insecure pages instead. The look varies by browser and version. Recognizing phishing messages remains your job.
Setting up HTTPS on a site
The steps are routine now:
- Get a certificate. Free automated authorities are available, and many hosts handle it for you. See automated certificates with ACME.
- Install the full chain along with the private key, and keep that key readable only by the server software.
- Allow TLS 1.2 and 1.3 and disable older versions.
- Redirect HTTP to HTTPS with a permanent redirect.
- Fix insecure subresources, covered in mixed content.
- Mark cookies
Secureso they're never sent over plain HTTP. - Add HSTS once everything works, so browsers insist on HTTPS. Read how HSTS works before choosing a long duration.
- Monitor expiry, even with automation.
To check what a server presents, use OpenSSL:
openssl s_client -connect example.com:443 -servername example.com </dev/null The output lists the certificate chain, the negotiated protocol version and cipher, and a verification result. Or ask curl for the same overview:
curl -vI https://example.com/ Common setup mistakes
Most HTTPS problems come from a short list of oversights:
- Missing names. The certificate covers
www.example.combut notexample.com, so one of the two shows a warning. Request every hostname you serve. - Missing intermediate. The server sends only its own certificate. It may look fine in your browser and fail in apps or scripts.
- Expired certificate. Renewal was manual, or automation renewed the file but the server never reloaded it.
- Half a migration. Pages load securely but still pull images or scripts over HTTP, or old links bounce through several redirects.
- Unprotected hop behind a proxy. The visitor's connection to a CDN or proxy is encrypted, while the proxy talks to your server in plain text across the public internet. Encrypt that leg too, and have the proxy verify your certificate.
- Exposed private key. The key was emailed, committed to a code repository or left readable by every account. Replace it and revoke the old certificate if that happens.
Test after each change from outside your own network, and include older devices you care about, since their trusted root lists may differ from yours.
Does HTTPS slow a site down?
The cost is small on current hardware, which has instructions for accelerating encryption. The main expense is the extra setup round trip when a connection opens, and TLS 1.3 reduced that to one. Connection reuse and session resumption cut it further.
HTTPS is also a practical requirement for speed features. Browsers support HTTP/2 only over TLS, and HTTP/3 builds TLS 1.3 into QUIC. The HTTP version comparison explains why those matter. Many powerful browser features, including service workers and location access, are limited to secure pages.
Common questions
Is HTTPS needed for a site with no logins?
Yes. Without it, someone on the path could inject content, ads or malicious scripts into your pages, and observers could see exactly which pages visitors read. Browsers also label plain HTTP pages as not secure.
Can my employer see my HTTPS traffic?
On your own unmanaged device, they generally see destinations rather than contents. On a company-managed device, an installed corporate root certificate can allow inspection, and monitoring software on the device can see anything you see. Workplace policy is the place to check.
Is TLS only for websites?
No. Email transport, many apps, APIs, VPNs and device connections use it too. The web is just where you notice it most.