Open to everyone Reading, lesson 49 of 100, 2 min read
TLS, HTTPS and certificates
The padlock
When a browser shows https:// and a padlock, the connection uses TLS (Transport Layer Security). TLS gives:
- encryption, so nobody on the network can read the page;
- integrity, so nobody can change it on the way;
- authentication of the server, so you know you reached the real site.
It does not mean the site is honest. Criminals can get certificates for their own look-alike domains too. The padlock tells you that you are privately connected to whoever owns that domain.
Certificates
A certificate is a digital document that says "this public key belongs to dmlschooloftechnology.org", signed by a certificate authority (CA). Browsers and phones come with a list of trusted CAs. When a site presents its certificate, the browser checks:
- The signature chains up to a trusted CA.
- The domain name matches the address you visited.
- The certificate has not expired or been revoked.
If any check fails, the browser shows a full-page warning. Do not click through those warnings on sites where you sign in or pay.
The handshake, simply
- Your browser says hello and lists the encryption methods it supports.
- The server sends its certificate.
- They agree on a fresh symmetric key using key exchange (ECDHE), so even if the server's private key leaks later, today's traffic stays protected (forward secrecy).
- Everything after that is encrypted with the symmetric key.
For people who run websites
- Use free, automatically renewed certificates such as those from Let's Encrypt.
- Allow only TLS 1.2 and 1.3.
- Send all HTTP visitors to HTTPS, and set HSTS so browsers always use HTTPS for your domain.
- Watch certificate expiry; an expired certificate breaks the site for everyone.
Note
If you took Linux Server Administration, you set up HTTPS with Let's Encrypt. Now you know what was happening underneath.