SSL/TLS Config Guide
TLS Version Support
| Version | Status | Recommendation |
|---|---|---|
| TLS 1.3 | โ Current | Enable โ fastest and most secure |
| TLS 1.2 | โ Legacy | Enable for compatibility (2015+ clients) |
| TLS 1.1 | โ Deprecated | Disable โ not supported by browsers since 2020 |
| TLS 1.0 | โ Deprecated | Disable โ vulnerable to POODLE, BEAST |
| SSL 2/3 | โ Insecure | Never enable |
Nginx Optimal TLS Config
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;
# TLS versions
ssl_protocols TLSv1.2 TLSv1.3;
# Cipher suites (TLS 1.2 fallback)
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off; # Let client pick in TLS 1.3
# Session resumption
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
# OCSP Stapling
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 valid=300s;
# HSTS (enable after testing)
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
}
Let's Encrypt Setup (Certbot)
# Install certbot sudo apt install certbot python3-certbot-nginx # Obtain certificate (auto-configures nginx) sudo certbot --nginx -d example.com -d www.example.com # Test auto-renewal sudo certbot renew --dry-run # Cron job (auto-renewal every 12h) 0 */12 * * * certbot renew --quiet --post-hook "nginx -s reload"
SSL Labs Score Requirements
| Grade | Requirements |
|---|---|
| A+ | HSTS preload, TLS 1.2+, strong ciphers only, OCSP stapling |
| A | TLS 1.2+, no weak ciphers, valid cert, HSTS |
| B | TLS 1.0/1.1 enabled or weak ciphers |
| F | Expired cert, critical vulnerability, SSL 3.0 enabled |