HTTPS
HTTPS is plain HTTP sent inside a TLS (Transport Layer Security) connection, usually on port 443. TLS gives three guarantees: confidentiality (nobody on the path can read the data), integrity (nobody can change it unnoticed) and authentication (you are really talking to shop.com, proven by a certificate). “SSL” is the name of TLS’s long-dead predecessor; every SSL version and TLS 1.0 and 1.1 are deprecated. Use TLS 1.3, with 1.2 as a fallback.
The TLS 1.3 handshake
| NO. | STEP | FROM | TO | TYPE | INFO |
|---|---|---|---|---|---|
| 1 | 01 | client | server | ClientHello | TLS 1.3, ciphers: TLS_AES_128_GCM_SHA256 …, SNI=shop.com, key_share: X25519MLKEM768 |
| 2 | 02 | server | client | ServerHello | chosen cipher + server key_share → both derive handshake keys |
| 3 | 03 | server | client | ENCRYPTED | EncryptedExtensions, Certificate (shop.com ← intermediate CA), CertificateVerify, Finished |
| 4 | 04 | client | client | VERIFY | chain → root CA in trust store · not expired · SAN matches shop.com |
| 5 | 04 | client | server | ENCRYPTED | Finished |
| 6 | 05 | client | server | APP DATA | HTTP request, AES-GCM encrypted |
- A TCP connection to port 443 is open. Nothing is encrypted yet.
- ClientHello: supported versions and ciphers, the server name (SNI), and a key share: the client's half of a key exchange.
- ServerHello carries the server's key share. Both sides now compute the same shared secret without ever sending it.
- Everything from here is encrypted ({ } = encrypted). The server sends its remaining settings and its certificate, then signs the handshake with its private key to prove it owns it.
- The client checks the certificate chain up to a trusted CA, the expiry and that the name matches shop.com, then sends Finished.
- Application data flows encrypted. The whole handshake took one round trip (TLS 1.2 needed two).
Two kinds of cryptography work together:
- Key exchange (ECDHE with X25519, and since 2024 to 2025 hybrid post-quantum X25519MLKEM768 by default in major browsers, Cloudflare and OpenSSL 3.5) lets both sides agree on a secret over an open network. New keys per connection give forward secrecy: stealing the server’s private key later does not decrypt old traffic.
- Signatures and certificates prove identity. The server’s certificate binds its public key to the name
shop.comand is signed by a certificate authority (CA) that your OS or browser already trusts.
After the handshake, data is encrypted with a fast symmetric cipher such as AES-GCM or ChaCha20-Poly1305.
The chain of trust
| Certificate | Signed by | Lives in |
|---|---|---|
Leaf: shop.com |
Intermediate CA | Sent by the server |
| Intermediate CA | Root CA | Sent by the server |
| Root CA | Itself | Your trust store (OS, browser, JVM cacerts, Python certifi) |
Let’s Encrypt and other ACME CAs issue free certificates automatically. Lifetimes are shrinking: the CA/Browser Forum has voted to cut maximum validity from 398 days to 200 days (March 2026), 100 days (2027) and 47 days (2029), so certificate renewal must be automated.
Common mistakes
- Disabling verification to “make it work” (
verify=False,curl -k,sslmode=requirewithoutverify-full). The connection is encrypted but you no longer know who is on the other end. - The server sends only the leaf certificate. Browsers may cope; Python, Java and Go clients fail with “unable to get local issuer certificate”. Serve the full chain.
- Corporate proxies with their own CA. Add the company root to the trust store your runtime actually uses (Java and Python often have their own).
- Expired certificates. The top cause of HTTPS outages. Automate renewal and alert on expiry.
- Mixed content. An HTTPS page that loads scripts over HTTP is blocked by browsers.
Try it
curl -vI https://shop.com 2>&1 | grep -E 'SSL|TLS|subject|issuer|expire'
openssl s_client -connect shop.com:443 -servername shop.com </dev/null | openssl x509 -noout -dates -subjectLearning Resources
- The Illustrated TLS 1.3 Connection: every byte of a real handshake, explained
- RFC 8446: TLS 1.3
- Bulletproof TLS and PKI: Ivan Ristić
- What is HTTPS?: Cloudflare Learning Center
- Let’s Encrypt: How It Works
- SSL Labs Server Test: check any public server’s TLS setup