Every login form, cookie and API call travels across networks you do not control: coffee-shop Wi-Fi, ISPs, backbone routers. HTTPS is the mechanism that keeps that traffic private and untampered. This lesson explains what TLS actually does, how certificates create trust, and how to configure HTTPS correctly on your own sites.
Plain HTTP sends everything in readable text. Anyone on the network path can read it (breaking confidentiality), alter it (breaking integrity), or impersonate the server entirely. HTTPS is simply HTTP running inside a TLS (Transport Layer Security) tunnel, which provides three guarantees:
When your browser connects to a site, the two sides perform a handshake:
Modern TLS 1.3 shortens this exchange and removes obsolete, weakened options entirely. If your servers still allow TLS 1.0 or 1.1, disable them.
A certificate binds a public key to a domain name, signed by a Certificate Authority (CA). Browsers trust a small set of root CAs; those roots sign intermediates, which sign your site's certificate, forming a chain. Free automated CAs such as Let's Encrypt issue certificates validated by proving control of the domain, and tools like Certbot renew them automatically. There is no longer any cost excuse for HTTP.
Certificates expire deliberately, limiting how long a stolen key is useful. Automate renewal and monitor expiry, because an expired certificate takes your site down with a scary browser warning.
Getting a certificate is step one; serving it well is step two. A solid setup redirects all HTTP to HTTPS and tells browsers to never try HTTP again using HSTS:
# Nginx: enforce HTTPS with modern TLS
server {
listen 80;
server_name example.com;
return 301 https://example.com$request_uri; # redirect all HTTP
}
server {
listen 443 ssl http2;
server_name example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3; # no legacy protocols
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
}The Strict-Transport-Security header (HSTS) instructs browsers to use HTTPS for your domain for a year, defeating downgrade tricks where an attacker forces a first request over plain HTTP.
http:// inside an HTTPS page weakens or breaks the protection; browsers now block much of it.Secure so they are never sent over plain HTTP, plus HttpOnly to keep scripts away from them.HTTPS secures the pipe, not the endpoints. A phishing site can have a perfectly valid certificate for its lookalike domain; the padlock means 'connection is private', not 'site is honest'. It also does nothing about vulnerabilities in your application code, which the next lessons address.
Next lesson: Encryption Basics: Symmetric vs Asymmetric, where we open the cryptographic toolbox TLS is built from.