File: //etc/apache2/mods-available/ssl.conf
<IfModule mod_ssl.c>
# Pseudo Random Number Generator (PRNG):
SSLRandomSeed startup builtin
SSLRandomSeed startup file:/dev/urandom 512
SSLRandomSeed connect builtin
SSLRandomSeed connect file:/dev/urandom 512
# Some MIME-types for downloading Certificates and CRLs
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
# Pass Phrase Dialog
SSLPassPhraseDialog exec:/usr/share/apache2/ask-for-passphrase
# Inter-Process Session Cache
SSLSessionCache shmcb:${APACHE_RUN_DIR}/ssl_scache(512000)
SSLSessionCacheTimeout 300
# Protocols - TLS 1.3 (Good) + TLS 1.2 (Sufficient) per NCSC TLS guidelines 2025-05
SSLProtocol -all +TLSv1.2 +TLSv1.3
# Cipher suites - ECDHE + AEAD only, no CBC, no DHE (all Sufficient/Good per NCSC)
SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305
# TLS 1.3 cipher suite ordering - Good (256-bit) first, Sufficient (128-bit) last
SSLCipherSuite TLSv1.3 TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256
# Prefer server cipher order - serve strongest ciphers first
SSLHonorCipherOrder on
# Curves - X25519 preferred (best ECDHE option currently available)
SSLOpenSSLConfCmd Curves X25519:P-256:P-384
# Disable compression - prevents CRIME attack (NCSC section 3.4.1)
SSLCompression off
# Session tickets off - avoids TLS 1.2 session ticket key exposure risk
SSLSessionTickets off
# OCSP Stapling - privacy-friendly certificate status check (NCSC section 3.4.5)
SSLUseStapling On
SSLStaplingCache shmcb:${APACHE_RUN_DIR}/ssl_stapling(32768)
# Insecure renegotiation - keep disabled (NCSC section 3.4.2)
#SSLInsecureRenegotiation on
# SNI strict checking - optional, uncomment if needed
#SSLStrictSNIVHostCheck On
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet