SSL/TLS Config Guide

TLS Version Support

VersionStatusRecommendation
TLS 1.3✓ CurrentEnable — fastest and most secure
TLS 1.2⚠ LegacyEnable for compatibility (2015+ clients)
TLS 1.1✗ DeprecatedDisable — not supported by browsers since 2020
TLS 1.0✗ DeprecatedDisable — vulnerable to POODLE, BEAST
SSL 2/3✗ InsecureNever 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

GradeRequirements
A+HSTS preload, TLS 1.2+, strong ciphers only, OCSP stapling
ATLS 1.2+, no weak ciphers, valid cert, HSTS
BTLS 1.0/1.1 enabled or weak ciphers
FExpired cert, critical vulnerability, SSL 3.0 enabled