TLS versions and ciphers in plain language
A TLS version is the revision of the protocol that secures a connection, and a cipher suite is the set of algorithms it uses; today you should allow TLS 1.2 and 1.3 and disable older versions.
- Updated Nov 27, 2026
- Markdown
Set a sensible ssl_protocols line in nginx and test which TLS versions your server accepts with openssl.
- A server with HTTPS already working
- openssl installed
TLS is the protocol that encrypts HTTPS traffic. It exists in several versions, and each connection uses one version plus one cipher suite, chosen during the handshake. For a public website the practical advice is short: allow TLS 1.2 and TLS 1.3, turn off everything older, and take cipher settings from a maintained reference instead of writing your own list.
How it works#
When a client connects, it sends a hello message listing the TLS versions it supports and the cipher suites it can use. The server picks the highest version both sides support and a suite from the shared list. Then the two sides agree on session keys, the server proves its identity with its certificate and the encrypted conversation starts. You can see the picture in HTTPS and Let’s Encrypt.
Versions in short:
- SSL 2.0 and 3.0: obsolete and broken. Never enable them.
- TLS 1.0 and 1.1: deprecated by RFC 8996 (published in 2021). They rely on older constructions with known weaknesses, and browsers and most vendors removed support. Disable them unless you must serve a specific legacy client.
- TLS 1.2: still widely used and acceptable when configured with modern suites. It keeps older but reasonable clients working.
- TLS 1.3: the current version (RFC 8446). The handshake is shorter, only modern algorithms remain, and all suites provide forward secrecy.
What a cipher suite is#
A cipher suite is a named bundle of algorithms. In TLS 1.2 the name spells out the parts, such as the key exchange, the authentication method, the bulk encryption cipher and the integrity function. In TLS 1.3 the suite names are shorter, because key exchange and authentication are negotiated separately and only strong authenticated encryption modes are left. You normally do not choose individual algorithms, but you do choose which suites the server will accept, and that list is where past misconfigurations hide: old suites with weak or removed algorithms.
Do not write cipher lists from memory or copy them from old blog posts. They go out of date. Use the Mozilla SSL Configuration Generator at https://ssl-config.mozilla.org/, choose your server (nginx, Apache, Caddy and others), your software versions and the compatibility level, and paste its output. Mozilla updates the recommendations as research changes.
Forward secrecy#
Forward secrecy (also called perfect forward secrecy) means each connection derives its session keys from a temporary key exchange, not directly from the server’s long term private key. If someone records encrypted traffic today and steals your private key next year, they still cannot decrypt the recorded sessions. TLS 1.3 requires forward secrecy for every connection. In TLS 1.2 it depends on the suite, which is one reason to use a maintained configuration that prefers ephemeral key exchange.
A sane nginx setting#
The version line itself is simple and stable:
ssl_protocols TLSv1.2 TLSv1.3;Put it in the http block or the server block that has listen 443 ssl. For the cipher list, copy the matching ssl_ciphers and related lines from the Mozilla generator rather than inventing them. Then test and reload:
sudo nginx -t && sudo systemctl reload nginxOther settings from the generator, such as session handling and OCSP stapling, can be adopted at the same time. Combine this with HSTS and a correct certificate chain for a complete server setup. Caddy sets safe defaults itself, see Automatic HTTPS with Caddy.
Check it worked#
Test each version with openssl by forcing it:
openssl s_client -connect example.com:443 -servername example.com -tls1_3 </dev/null
openssl s_client -connect example.com:443 -servername example.com -tls1_2 </dev/null
openssl s_client -connect example.com:443 -servername example.com -tls1_1 </dev/nullFor the first two you should see a certificate and a line with Protocol (or Protocol version) naming the negotiated version, plus a Cipher line showing the suite in use. For the third, a server that has disabled TLS 1.1 should fail the handshake with an alert, and no certificate chain will be printed. If your local openssl was built without support for old protocols, the flag may be rejected locally, which tells you nothing about the server. In that case use a different tool, such as an online scanner or nmap --script ssl-enum-ciphers -p 443 example.com against a server you own.
With curl you can also force a version, for example curl -sI --tlsv1.2 --tls-max 1.2 https://example.com.
Edge cases and gotchas#
- Legacy clients: very old devices, embedded systems and some old Java or Android versions may only speak TLS 1.0 or 1.1. Decide per case whether to support them, and isolate them if you must.
- Reload, not restart: version changes apply on
reload, and settings in the wrong block may be ignored if a more specific server block overrides them. - Default server block: nginx may apply the protocols of the first or default server for a shared IP, so set it consistently.
- TLS in other places: databases, mail servers and internal proxies have their own version and cipher settings.
- A scan is not a guarantee: a clean report only covers the endpoints and options tested.
- Do not copy stale lists: old recommendations can include suites that are now considered weak, so regenerate periodically.
Troubleshooting#
| Symptom | Likely cause | Fix |
|---|---|---|
| Old client gets “handshake failure” | Server no longer accepts its TLS version or suites | Update the client, or decide whether to allow a legacy path |
| s_client -tls1_1 succeeds on your server | ssl_protocols still lists it, or another block answers | Set ssl_protocols TLSv1.2 TLSv1.3;, reload, retest |
| openssl: unknown option -tls1_1 | Local openssl lacks old protocols | Test with another tool or machine |
| Changes have no effect | nginx not reloaded, or directive overridden in a server block | Run nginx -t, reload and check which block matches |
| Scanner warns about weak ciphers | Outdated ssl_ciphers line | Regenerate from the Mozilla generator |
| TLS 1.3 not offered | Old nginx or openssl library | Upgrade packages so the server links a TLS 1.3 capable library |
Quick reference#
ssl_protocols TLSv1.2 TLSv1.3;
# ssl_ciphers and related lines: copy from https://ssl-config.mozilla.org/openssl s_client -connect example.com:443 -servername example.com -tls1_3 </dev/null
openssl s_client -connect example.com:443 -servername example.com -tls1_2 </dev/nullRelated lessons#
- Inspect a TLS certificate with openssl: more openssl s_client usage.
- HSTS explained: force browsers onto HTTPS.
- Certificate chains and intermediates explained: the other side of a correct handshake.
- Nginx reverse proxy with certbot: where these directives live.
- How TLS certificates are issued: how the certificate in the handshake is obtained.
Next#
Return to the track start with HTTPS and Let’s Encrypt.
Check what you learned
Frequently asked questions
Which TLS version should I use?
Allow TLS 1.2 and TLS 1.3. TLS 1.3 is preferred by modern clients, and TLS 1.2 keeps older clients working.
Why are TLS 1.0 and 1.1 deprecated?
RFC 8996 formally deprecated them because of known weaknesses and because modern versions replace them. Major browsers and many vendors dropped support for them.
What is a cipher suite?
A cipher suite names the algorithms a connection uses for key exchange, authentication, encryption and message integrity. The client offers a list and the server picks one it supports.
Where can I get a safe nginx TLS configuration?
Use the Mozilla SSL Configuration Generator at https://ssl-config.mozilla.org/. It produces current settings for your server software and chosen compatibility level.
Sources
Keep going: guides and tutorials
- Self-Hosted Static Site Hosting: Deploy a Folder With Levelrail Self-hosted static site hosting from a plain folder: one deploy command, _redirects, _headers and a custom 404 honored, plus a one command rollback.
- Deploy Next.js on a VPS With Docker, Git Push and HTTPS Deploy a Next.js app to your own VPS with Docker, a health check, HTTPS and rollback. Includes the NEXT_PUBLIC build trap that leaves variables empty.