|
1 | | -# This is a shared hardened SSL conf provided by TurnKey |
2 | | -# created 2021-11-11 using guidance from Mozilla Guideline v5.6 |
3 | | -# https://ssl-config.mozilla.org/#server=lighttpd&version=1.4.59&config=intermediate&openssl=1.1.1k&hsts=false&guideline=5.6 |
| 1 | +# This is a custom shared hardened SSL conf provided by TurnKey |
| 2 | +# created 2025-20-11 using guidance from Mozilla Guideline v5.7 |
| 3 | +# https://ssl-config.mozilla.org/#server=lighttpd&version=1.4.79&config=intermediate&openssl=3.5.1&guideline=5.7 |
| 4 | +# By default this file is sourced by /etc/lighttpd/conf-available/10-ssl.conf |
4 | 5 |
|
5 | 6 | ssl.pemfile = "/etc/ssl/private/cert.pem" |
6 | 7 | ssl.privkey = "/etc/ssl/private/cert.key" |
7 | 8 | ssl.dh-file = "/etc/ssl/private/dhparams.pem" |
8 | 9 |
|
9 | | -ssl.openssl.ssl-conf-cmd = ( |
10 | | - "MinProtocol" => "TLSv1.2", |
11 | | - "Options" => "-ServerPreference", |
12 | | - # ciphers set by common/conf/turnkey.d/zz-ssl-ciphers |
13 | | - "CipherString" => "ZZ_SSL_CIPHERS" |
14 | | -) |
| 10 | +ssl.openssl.ssl-conf-cmd = ("MinProtocol" => "TLSv1.2") |
| 11 | +# lighttpd 1.4.79 TLS default appends X448 |
| 12 | +#ssl.openssl.ssl-conf-cmd += ("Curves" => "X25519:prime256v1:secp384r1") |
15 | 13 |
|
16 | | -setenv.add-response-header = ( |
17 | | - # HTTP Strict Transport Security (63072000 seconds) |
| 14 | +# lighttpd TLS defaults are widely supported by clients and should be preferred. |
| 15 | +# See https://wiki.lighttpd.net/Docs_SSL |
| 16 | +# Uncomment to better match the less restricted Mozilla intermediate spec. |
| 17 | +# (TKL Ciphers set by common/conf/turnkey.d/zz-ssl-ciphers) |
| 18 | +#ssl.openssl.ssl-conf-cmd += ("CipherString" => "ZZ_SSL_CIPHERS") |
| 19 | + |
| 20 | +# HSTS config + additional hardening |
| 21 | +server.modules += ("mod_redirect") |
| 22 | +server.modules += ("mod_setenv") |
| 23 | +$HTTP["scheme"] == "https" { |
| 24 | + # HTTP Strict Transport Security (63072000 seconds) |
| 25 | + setenv.add-response-header = ( |
18 | 26 | "Strict-Transport-Security" => "max-age=63072000; includeSubdomains; preload", |
19 | 27 | "X-Frame-Options" => "DENY", |
20 | | - "X-Content-Type-Options" => "nosniff" |
21 | | -) |
| 28 | + "X-Content-Type-Options" => "nosniff", |
| 29 | + ) |
| 30 | +} |
| 31 | +else $HTTP["scheme"] == "http" { |
| 32 | + url.redirect = ("" => "https://${url.authority}${url.path}${qsa}") |
| 33 | +} |
| 34 | + |
| 35 | +# OCSP stapling config (disabled by default) |
22 | 36 |
|
23 | 37 | # OCSP stapling (input file is maintained by external 'cert-staple.sh' script) |
24 | 38 | # https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_SSL#OCSP-Stapling |
|
0 commit comments