SSL/TLS configuration में काफी बदलाव आए हैं। यह 2026 के हिसाब से best practices की current state है — क्या enable करें, क्या disable करें, और आगे क्या आने वाला है।
Protocol versions
| Protocol | Status | Action |
|---|---|---|
| SSL 2.0, 3.0 | Broken | Disable करें — serious vulnerabilities (POODLE, DROWN) |
| TLS 1.0 | Deprecated (2021) | Disable करें — BEAST vulnerability |
| TLS 1.1 | Deprecated (2021) | Disable करें — कोई modern cipher support नहीं |
| TLS 1.2 | Secure | Enable करें — सिर्फ AEAD ciphers के साथ |
| TLS 1.3 | Current standard | Enable करें — सबसे fast, सबसे secure |
Nginx: ssl_protocols TLSv1.2 TLSv1.3;
Apache: SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
Cipher suites
TLS 1.3 (कोई configuration जरूरी नहीं)
सभी 5 cipher suites secure हैं। Customize करने की कोशिश न करें — आप इसे better नहीं बना सकते।
TLS 1.2 (सिर्फ AEAD तक limit करें)
# Nginx
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256';
ssl_prefer_server_ciphers off;
Rules:
- सिर्फ
ECDHE-*suites — forward secrecy ensure करता है - सिर्फ
*-GCM-*या*-CHACHA20-*— only AEAD ciphers - कोई CBC ciphers नहीं — BEAST, Lucky13 के लिए vulnerable
ssl_prefer_server_ciphers off— client को choose करने दें (modern clients best option चुनते हैं)
Certificate management
| Practice | क्यों |
|---|---|
| ECDSA P-256 keys use करें | RSA 2048 से छोटी, fast |
| Renewal automate करें | 2029 तक 47-day validity manual renewal को impractical बनाती है |
fullchain.pem serve करें | Chain of trust errors रोकता है |
| Certificate expiry monitor करें | 90 में से 60th day के लिए alerts set करें |
| Certificate Transparency monitoring use करें | unauthorized certificates पकड़ें |
| Renewal पर keys rotate करें | certificates के बीच private keys reuse न करें |
Security headers
# HSTS — हमेशा HTTPS use करें (छोटे max-age से start करें, बाद में बढ़ाएँ)
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
# MIME-type sniffing रोकें
add_header X-Content-Type-Options "nosniff" always;
# Clickjacking रोकें
add_header X-Frame-Options "SAMEORIGIN" always;
# Insecure sub-resources upgrade करें
add_header Content-Security-Policy "upgrade-insecure-requests" always;
Performance optimization
| Setting | Config | Benefit |
|---|---|---|
| HTTP/2 | listen 443 ssl http2; | Multiplexing, header compression |
| Session caching | ssl_session_cache shared:SSL:10m; | Returning visitors के लिए re-handshake avoid करें |
| Session tickets off | ssl_session_tickets off; | Better forward secrecy |
| OCSP stapling | ssl_stapling on; | Fast cert verification, better privacy |
| Early data (0-RTT) | TLS 1.3 default | Zero-latency resumption (carefully use करें) |
Full Nginx config (production-ready)
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name example.com www.example.com;
ssl_certificate /etc/ssl/fullchain.pem;
ssl_certificate_key /etc/ssl/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256';
ssl_prefer_server_ciphers off;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 1d;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
root /var/www/html;
}
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
return 301 https://$host$request_uri;
}
Test करें: अपना domain SSL Labs पर paste करें — इस config को A+ score मिलना चाहिए।
क्या न करें
| Bad practice | क्यों | इसकी जगह क्या करें |
|---|---|---|
ssl_protocols TLSv1 TLSv1.1; | Deprecated, vulnerable | सिर्फ TLS 1.2 + 1.3 |
ssl_ciphers ALL; | Weak ciphers include हैं | Explicit ECDHE + AEAD list |
ssl_prefer_server_ciphers on; (TLS 1.3) | Unnecessary — TLS 1.3 ciphers सब secure हैं | off |
fullchain.pem की जगह cert.pem use करना | chain missing → trust errors | Nginx के लिए हमेशा fullchain.pem |
| Production में self-signed certs | Browser warnings, कोई trust नहीं | Let’s Encrypt (free) |
| सालों तक same private key | Damage containment limit करता है | हर renewal पर rotate करें |
| कोई HSTS नहीं | Downgrade attacks के लिए vulnerable | Testing के बाद enable करें |
HSTS के लिए max-age=0 | Effectively HSTS disable करता है | 300 से start करें, 63072000 तक बढ़ाएँ |
FAQ
मैं अपनी SSL configuration कैसे test करूँ?
SSL Labs Server Test — अपना domain enter करें, letter grade (A-F) के साथ detailed report मिलेगी। Protocol support, cipher strength, chain validity, और known vulnerabilities check करें।
किस grade को target करना चाहिए?
Production sites के लिए A+। इसके लिए जरूरी है: सिर्फ TLS 1.2+, AEAD ciphers, valid chain, लंबे max-age के साथ HSTS। ऊपर दी गई config A+ देती है।
SSL config कितनी बार review करनी चाहिए?
Yearly, या जब कोई नई vulnerability announce हो। Let’s Encrypt के status page subscribe करें और updated recommendations के लिए Mozilla SSL Configuration Generator follow करें।
क्या कोई tool है जो सही config generate करता है?
हाँ — Mozilla SSL Configuration Generator। अपना server (Nginx, Apache, etc.), अपना server version choose करें, और यह एक recommended config generate करता है। “Modern” profile इस article में दी गई practices से match करता है।