Updated 10 hours ago
Cipher suite selection is the part of TLS configuration where you decide what cryptography your server will actually use. Get it wrong, and your encrypted connections might as well be plaintext.
The good news: TLS 1.3 made this nearly impossible to mess up. The bad news: TLS 1.2 is still everywhere, and it has dozens of cipher suites—some secure, some dangerously broken.
TLS 1.3: The Easy Case
TLS 1.3 has only five cipher suites, and they're all good:
- TLS_AES_256_GCM_SHA384
- TLS_AES_128_GCM_SHA256
- TLS_CHACHA20_POLY1305_SHA256
- TLS_AES_128_CCM_SHA256
- TLS_AES_128_CCM_8_SHA256
Enable all of them. The hard decisions disappeared with TLS 1.2.
TLS 1.2: Where Choices Matter
TLS 1.2 cipher suites have four components, and each one can be secure or catastrophically broken:
Key Exchange: How the session key is established
- ECDHE: Secure. Provides Perfect Forward Secrecy.
- DHE: Secure if configured correctly (2048-bit minimum).
- RSA: No forward secrecy. Compromise the private key, decrypt all past traffic.
Authentication: How the server proves its identity
- ECDSA: Secure. Smaller, faster signatures.
- RSA: Secure. More common certificates.
Encryption: How data is actually encrypted
- AES-GCM: Secure. Fast with hardware acceleration.
- ChaCha20-Poly1305: Secure. Fast without hardware acceleration.
- AES-CBC: Problematic. Source of numerous vulnerabilities.
- 3DES: Broken. Vulnerable to Sweet32 attack.
- RC4: Completely broken. Never use.
Hash: Integrity verification
- SHA-384, SHA-256: Secure.
- SHA-1: Deprecated. Avoid.
- MD5: Broken. Never use.
The Secure TLS 1.2 List
These cipher suites combine secure components:
That's it. Six cipher suites cover virtually all secure use cases. Everything uses ECDHE for forward secrecy and authenticated encryption (GCM or Poly1305).
Choose ECDSA variants if your certificate uses ECDSA. Choose RSA variants if your certificate uses RSA. Most sites use RSA certificates.
What to Disable
Explicitly disable these—they're not just old, they're dangerous:
| Category | Why It's Broken |
|---|---|
| NULL encryption | No encryption at all. The name is literal. |
| Anonymous DH (ADH) | No authentication. Anyone can impersonate your server. |
| Export ciphers | Deliberately weakened for 1990s US export laws. Trivially broken. |
| RC4 | Cryptographically shattered. Even RC4-128 is unsafe. |
| 3DES | 64-bit blocks mean practical attacks after ~32GB of data. |
| MD5-based | Hash collisions are cheap to compute. |
Ordering: Put the Best First
Servers negotiate cipher suites in order of preference. Configure your server to:
- Use server preference rather than client preference
- Order by security and performance for your hardware
For servers with AES-NI (most modern x86):
For servers without AES hardware acceleration (some ARM, older systems):
ChaCha20 is implemented in software and runs fast everywhere. AES-GCM is only fast with hardware support.
Server Configuration
Nginx:
Apache:
Mozilla's SSL Configuration Generator (ssl-config.mozilla.org) produces tested configurations for most web servers. Use the "Intermediate" profile for most sites.
Testing Your Configuration
SSL Labs (ssllabs.com/ssltest): Comprehensive analysis with a letter grade. Aim for A or A+.
OpenSSL command line:
Check which cipher suite was negotiated.
Browser DevTools: In the Security tab, verify connections use your preferred cipher suites.
Common Mistakes
Enabling weak ciphers "for compatibility": Clients old enough to need RC4 or 3DES are security liabilities. Supporting them endangers everyone else on your server. Modern browsers have supported strong cipher suites for over a decade.
Using old configurations: A configuration from 2015 might enable ciphers now considered broken. Review annually.
Ignoring server preference: If clients choose cipher suites, they might choose poorly. Your server should decide.
Enabling everything: More cipher suites means more attack surface. Six secure options is plenty.
Frequently Asked Questions About Cipher Suites
Was this page helpful?