iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up

TLS Pitfalls

Authorised TLS testing validates that your servers, libraries, and configurations resist the well-known TLS attacks (BEAST, CRIME, POODLE, Heartbleed, ROBOT, Logjam, SWEET32, downgrade). Stay strictly on assets you own, use defensive tooling, and let the findings drive the cipher suite + protocol changes that close the gap.

Authorised TLS testing + hardening

EXAMPLE
# ===== 1) Rules of engagement (excerpt) =====
# Targets:    only the lab + staging hosts listed and signed off
# Off-limits: any production traffic that does not belong to the engagement
# Window:     2026-06-18 09:00 - 17:00 AEST
# Goal:       enumerate supported protocols + ciphers, identify weak config,
#             deliver hardening recommendations
# Stop:       monitoring page, RoE end time, > 30s sustained latency for legitimate clients

# ===== 2) Tools — defensive enumeration =====
# testssl.sh -- comprehensive
sudo apt install -y testssl.sh
testssl.sh https://target.lab.example.test
# Output: protocol support, cipher suites, certificate, vulnerabilities

# nmap script
nmap --script ssl-enum-ciphers -p 443 target.lab.example.test

# qualys SSL Labs (web UI)
# https://www.ssllabs.com/ssltest/analyze.html?d=target.lab.example.test
# Manual / triggered scan; deep reports for HTTPS endpoints.

# openssl one-liners
openssl s_client -connect target.lab.example.test:443 -servername target.lab.example.test
openssl s_client -tls1_2 -connect target.lab.example.test:443        # force 1.2
openssl s_client -tls1_3 -connect target.lab.example.test:443        # force 1.3
openssl s_client -no_tls1_3 -no_tls1_2 -no_tls1_1 -connect target.lab.example.test:443  # SSL3 attempt (should fail)

# ===== 3) Vulnerability checklist =====
# Run testssl.sh and inspect:
# - SSL2/SSL3 (POODLE) supported?           -> DISABLE
# - TLS 1.0 / TLS 1.1?                       -> DISABLE
# - RC4 ciphers?                              -> DISABLE
# - 3DES (SWEET32)?                          -> DISABLE
# - DH key size < 2048?                       -> increase (Logjam)
# - Heartbleed?                                -> patch OpenSSL
# - ROBOT (RSA bleichenbacher)?               -> use ECDHE-only ciphers
# - DROWN?                                     -> disable SSL2 on ALL services sharing the cert
# - CRIME / BREACH (compression)?              -> disable TLS compression; mitigate BREACH at app level
# - Insecure renegotiation?                    -> require RFC 5746
# - Expired or weak cert?                       -> rotate via Let's Encrypt / CA

# ===== 4) Cipher suite + protocol baseline (modern) =====
# Mozilla 'intermediate' guideline (2026):
# - TLS 1.2 + TLS 1.3 only
# - Cipher suites (TLS 1.3): TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_AES_128_GCM_SHA256
# - Cipher suites (TLS 1.2): ECDHE-ECDSA-AES256-GCM-SHA384, ECDHE-RSA-AES256-GCM-SHA384,
#                              ECDHE-ECDSA-CHACHA20-POLY1305, ECDHE-RSA-CHACHA20-POLY1305
# - HSTS: max-age >= 31536000; includeSubDomains; preload
# - OCSP Must-Staple (optional, controversial)
# - Strong DH params (2048-bit minimum, 3072 preferred) OR ECDHE only
# - Certificate Transparency monitoring

# nginx example
# server {
#   listen 443 ssl http2;
#   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';
#   ssl_prefer_server_ciphers off;     # TLS 1.3 negotiates; let modern clients pick
#   ssl_session_cache shared:SSL:10m;
#   ssl_session_timeout 1h;
#   ssl_session_tickets off;
#   add_header Strict-Transport-Security 'max-age=63072000; includeSubDomains; preload' always;
# }

# ===== 5) Mutual TLS (mTLS) for service-to-service =====
# - issue client certs from an internal CA
# - configure server to require + verify them
# - rotate via cert-manager / Vault PKI

# nginx mTLS
# ssl_client_certificate /etc/ssl/internal-ca.crt;
# ssl_verify_client on;

# ===== 6) Certificate Transparency monitoring =====
# Subscribe to CT log alerts (Cert Spotter, crt.sh, Cloudflare CT).
# Find out the moment a rogue cert is minted for your domain.

# ===== 7) HSTS + preload =====
# Set HSTS header AT LEAST 6 months before submitting to preload list
# Preload list = https://hstspreload.org
# Once preloaded, browsers REFUSE plaintext. Hard to undo — verify your config first.

# ===== 8) Pinning (mobile) =====
# iOS: NSAppTransportSecurity + cert pinning via URLSession delegate
# Android: OkHttp CertificatePinner + Network Security Config
# Rotate with TWO pins (current + next) to avoid bricking the app on rotation.

# ===== 9) Reporting =====
cat <<'EOF'
## Finding: TLS 1.0 + TLS 1.1 enabled on target.lab.example.test
Severity: High (compliance, cipher integrity)
Scope:    target.lab.example.test:443
Evidence: testssl.sh report 'TLS 1.0 offered'
Fix:
  - nginx: ssl_protocols TLSv1.2 TLSv1.3;
  - load balancer: equivalent setting
  - verify with: nmap --script ssl-enum-ciphers -p 443
Defence-in-depth:
  - HSTS preload
  - CT monitoring
  - mTLS for service-to-service
EOF

# ===== 10) Cleanup =====
# - Capture pcap / testssl output in the engagement archive
# - Delete local artefacts after writing into the report
# - Encrypt archive (gpg) and share only via the client's secure channel
# - Verify the hardened config in a final pass after the fix lands

Why it matters

A clean TLS posture in 2026 is: TLS 1.2 + 1.3 only, modern ciphers, HSTS preload, valid managed certificate, CT monitoring. authorised testing confirms it; hardening keeps it. The reporting value of an engagement is "we walked through every protocol/cipher and the only ones offered are the safe ones" — exactly the assurance customers and auditors care about.

Tip: Tweak the snippet with Try it Yourself », then sit the quiz at the bottom of the page.

Example

Example
# Findings to flag in scope:
#   - TLS < 1.2 enabled (downgrade risk)
#   - Weak ciphers (RC4, 3DES, EXPORT)
#   - Mismatched / expired certs
#   - No HSTS / no preload / mixed content
# Tools: testssl.sh, ssllabs.com.
Try it Yourself »

Discussion

Loading…