Skip to content
GEEKnodes

Computing

How HTTPS Works: TLS, Certificates and the Browser Padlock

What HTTPS does under the hood: symmetric and asymmetric encryption, the TLS handshake, certificates, Let’s Encrypt and what the padlock really guarantees.

You see the padlock next to the address and think the site is safe. That’s partly true, but the padlock promises a lot less than many people think. In this guide you’ll see what really happens when you open a site over HTTPS: how the connection is encrypted, what a certificate is for, who signs it and what the errors that sometimes stop you in your tracks mean.

In short

  • HTTPS is HTTP inside a TLS tunnel: it encrypts the data and checks that you’re talking to the right server.
  • The certificate proves that the server controls that domain, signed by an authority your browser trusts.
  • The padlock doesn’t mean the site is honest: a phishing site can have HTTPS too.

What HTTPS adds to HTTP

HTTP is the language the browser uses to request pages. On its own it travels in plain text: anyone in between (the coffee shop Wi-Fi, a compromised router) can read what you send and modify what you receive.

HTTPS wraps that conversation in TLS (Transport Layer Security, the successor to the old SSL; out of habit people still say “SSL certificate”). TLS provides three guarantees:

GuaranteeWhat it meansWithout it
ConfidentialityNo one in between can read the dataPasswords and forms in plain sight
IntegrityNo one can modify it without it being noticedAds or code injected into the page
AuthenticationYou’re talking to the domain ownerAn impostor could pose as the site

Symmetric and asymmetric encryption, explained simply

TLS combines two types of encryption because each one is good at something.

Symmetric: the same key encrypts and decrypts. It’s like a safe with a single key that both parties have. It’s very fast, ideal for moving megabytes of data. Typical algorithms: AES and ChaCha20. The problem: how do you agree on the key without anyone seeing it along the way?

Asymmetric: each party has a key pair, one public and one private. What’s signed with the private key is verified with the public key, and it lets you agree on secrets over a channel everyone is listening to. It’s like an open padlock you hand out to anyone who wants one: anyone can snap it shut, but only you have the key. It’s slow, but it solves the key problem.

TLS uses asymmetric encryption at the start, to authenticate the server and agree on a key, and then switches to symmetric for everything else.

The TLS handshake

Before a single byte of the page is sent, browser and server perform a handshake. Simplified, in TLS 1.3:

  1. Client hello: the browser says which versions and algorithms it supports and sends its half of a key exchange.
  2. Server hello: the server picks the algorithms and sends its half of the exchange. With both halves, each side calculates the same symmetric key without it ever traveling over the network.
  3. Certificate: the server sends its certificate and a signature made with its private key that proves it owns it.
  4. Verification: the browser checks the certificate (domain, dates, the authority’s signature).
  5. Finished: both confirm that no one has tampered with the greeting and encrypted traffic begins.
TLS 1.3 handshake sequence between browser and server: hello, key exchange, certificate, verification and encrypted traffic
In TLS 1.3, the whole greeting fits in a single round trip

In TLS 1.3 all of this fits in a single round trip, which is why you barely notice it. What’s more, each session’s key is ephemeral: even if someone stole the server’s private key one day, it wouldn’t help them decrypt conversations recorded earlier.

You can watch a real handshake from the terminal:

curl -vI https://www.wikipedia.org 2>&1 | grep -E "SSL connection|subject|issuer|expire"
openssl s_client -connect www.wikipedia.org:443 -servername www.wikipedia.org -brief

Certificates and the chain of trust

A certificate is a digital document that basically says: “public key X belongs to the domain ejemplo.es, valid until such-and-such a date”, signed by a certificate authority (CA).

Chain of trust: a preinstalled root certificate signs the intermediate, which signs the site certificate
The root signs the intermediate and the intermediate signs the site: the server must send both

And why trust the CA? Because your operating system and browser ship with a list of root certificates from audited CAs. Trust works as a chain:

Root certificate (preinstalled on your device)
  └── Intermediate certificate (signed by the root)
        └── Site certificate (signed by the intermediate)

Roots are kept under heavy protection and almost never sign directly; for day-to-day use they rely on intermediates. The server must send its certificate and the intermediate. If it leaves out the intermediate, some browsers work around it and others throw an error: it’s a very common configuration mistake.

There are different types of validation:

TypeWhat the CA checksWhen it’s used
DV (domain validation)That you control the domainThe vast majority of websites
OV (organization validation)The domain and that the company existsCorporate websites
EV (extended validation)A stricter check of the companyIt used to be shown in green; browsers no longer highlight it

What the padlock guarantees and what it doesn’t

The padlock (or the settings icon some browsers now show in its place) means one specific thing: the connection to this domain is encrypted and the server has proven that it controls that domain.

It doesn’t mean:

  • That the company behind it is legitimate.
  • That the site isn’t a scam.
  • That the domain is the one you think it is: banco-seguro-acceso.com can have a perfectly valid certificate.

Getting a DV certificate is free and automatic, so most phishing sites have HTTPS. What you need to check is the exact domain in the address bar, not the padlock. The reverse does work as a warning sign: if a site asks for your details without HTTPS, don’t enter them.

Let’s Encrypt and expiration

Let’s Encrypt is a nonprofit certificate authority that issues DV certificates for free and automatically using the ACME protocol. It was key to HTTPS going from a minority to nearly universal.

Its certificates last 90 days, on purpose: it forces you to automate renewal and limits the damage if a key leaks. On top of that, the industry has agreed to gradually shorten the maximum lifetime of all public certificates over the coming years, so manual renewal’s days are numbered.

On your own server, the best-known client is Certbot:

sudo certbot --nginx -d ejemplo.es -d www.ejemplo.es
sudo certbot renew --dry-run

The second command simulates the renewal. If it passes, the automatic task Certbot installs will take care of renewing before the certificate expires.

Common certificate errors and what they mean

Message (Chrome / Firefox)What’s happeningWhat to do
NET::ERR_CERT_DATE_INVALID / SEC_ERROR_EXPIRED_CERTIFICATEExpired certificate, or your device’s clock is wrongCheck the device’s date; if it’s right, let the site know
NET::ERR_CERT_COMMON_NAME_INVALID / SSL_ERROR_BAD_CERT_DOMAINThe certificate is for a different domainDon’t continue if it’s a site where you sign in
NET::ERR_CERT_AUTHORITY_INVALID / SEC_ERROR_UNKNOWN_ISSUERSigned by an unknown CA, self-signed or missing the intermediateNormal on a home router or NAS; suspicious on a public site
ERR_SSL_VERSION_OR_CIPHER_MISMATCHServer with old TLS that the browser no longer acceptsA server problem; it needs updating
Padlock with a warning or partial “not secure”Mixed content: the page is HTTPS but loads resources over HTTPA problem with the site, not your device

If the error shows up on every site at once, the culprit is on your end: a system clock that’s off, an antivirus that inspects HTTPS or a public Wi-Fi captive portal you haven’t accepted yet.

Common mistakes

  • Trusting the padlock as a seal of honesty. Always check the domain.
  • Clicking “Continue anyway” out of habit. On your router’s admin page it may be acceptable; on your bank’s site, never.
  • Thinking HTTPS hides which sites you visit. It encrypts the content and the path, but your ISP can tell which domain you’re connecting to, for example through DNS queries.
  • Forgetting renewal on your own server. Automate it and test with --dry-run.
  • Serving the certificate without the intermediate. It works in your browser and fails on someone else’s phone.

Accessibility preferences

Quick profiles

Text and reading

Text size
Default
Line height
Default
Letter spacing
Default
Word spacing
Default

Colour

Motion and orientation

Cursor