Implementing SSL/TLS Configuration

1. Configuring SSL Certificates

TypeUse
DV (Domain Validation)Free, automated (Let's Encrypt)
OV (Organization)Org identity verified
EV (Extended)Legal entity check
Wildcard*.example.com
SAN/Multi-domainMultiple FQDNs

Example: NGINX SSL config

server {
  listen 443 ssl http2;
  ssl_certificate     /etc/ssl/fullchain.pem;
  ssl_certificate_key /etc/ssl/privkey.pem;
  ssl_protocols       TLSv1.2 TLSv1.3;
  ssl_prefer_server_ciphers off;
  ssl_ciphers         ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;
  ssl_session_timeout 1d;
  ssl_session_cache   shared:SSL:50m;
  ssl_session_tickets off;
  ssl_stapling on;
  ssl_stapling_verify on;
}

2. Setting TLS Protocol Versions

VersionStatus
TLS 1.3Preferred (0-RTT, simpler)
TLS 1.2Allowed (broad compat)
TLS 1.1 DEPRECATEDDisable
TLS 1.0 DEPRECATEDDisable (PCI requires)
SSL 3.0 DEPRECATEDDisable (POODLE)

3. Configuring Cipher Suites

SuiteNotes
TLS_AES_256_GCM_SHA384TLS 1.3 strong
TLS_CHACHA20_POLY1305_SHA256TLS 1.3 mobile fast
ECDHE-ECDSA-AES128-GCM-SHA256TLS 1.2 modern
RC4, 3DES, MD5Disable

4. Implementing Mutual TLS (mTLS)

Example: NGINX mTLS

ssl_client_certificate /etc/ssl/ca.crt;
ssl_verify_client      on;
ssl_verify_depth       2;
# Forward client cert info
proxy_set_header X-Client-Cert-CN $ssl_client_s_dn;
proxy_set_header X-Client-Cert-Verify $ssl_client_verify;

5. Setting Up Certificate Pinning

MethodNotes
HPKP DEPRECATEDBrowser removed
App-level pinMobile apps (recommended)
Pin SPKI hashSurvives cert renewal
Backup pinAlways include 2+

6. Configuring SNI (Server Name Indication)

PropertyDetail
Multi-cert per IPPick cert by hostname
SNI in ClientHelloNot encrypted (TLS 1.2)
ECH (Encrypted ClientHello)Hides SNI NEW
SNI requiredReject if absent

7. Implementing Certificate Rotation

Cert Rotation Flow

  1. Provision new cert (30d before expiry)
  2. Deploy to staging, validate
  3. Update load balancer / gateway config
  4. Graceful reload (nginx -s reload)
  5. Verify with openssl s_client
  6. Update monitoring with new expiry

8. Setting Up OCSP Stapling

SettingPurpose
ssl_stapling onEnable
ssl_stapling_verify onValidate OCSP response
resolverDNS for OCSP responder
Must-StapleCert extension forces stapling

9. Configuring SSL Session Caching

MethodNotes
Session ID cacheServer-side, shared mem
Session ticketsClient-side, stateless
TLS 1.3 PSK0-RTT resumption
Warning: Disable session tickets or rotate ticket keys daily — old keys break forward secrecy.

10. Using Let's Encrypt Integration

Example: Certbot with auto-renewal

certbot --nginx -d api.example.com -d www.api.example.com \
  --email ops@example.com --agree-tos --no-eff-email \
  --deploy-hook "systemctl reload nginx"

# Cron: auto-renew (Certbot installs systemd timer)
0 */12 * * * certbot renew --quiet
ToolUse
CertbotMost common, plugins
acme.shLightweight shell
cert-managerKubernetes native
CaddyAuto HTTPS built-in