Skip to content

Commit 783a7c0

Browse files
committed
Update lighty ssl conf - inc sync default 10-ssl.conf with that provided by lighttpd-mod-openssl pkg
1 parent c10317d commit 783a7c0

2 files changed

Lines changed: 33 additions & 17 deletions

File tree

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
# /usr/share/doc/lighttpd/ssl.txt (in 'lighttpd-doc' package)
1+
# /usr/share/doc/lighttpd/ssl.txt
2+
# -*- conflicts: mbedtls, gnutls, nss, wolfssl -*-
23

34
server.modules += ( "mod_openssl" )
45

6+
# ssl.* in global scope gets inherited by
7+
# $SERVER["socket"] == "..." { ssl.engine = "enable" }
8+
59
# Use TurnKey hardened SSL/TLS defaults for all SSL/TLS traffic.
610
include "ssl-params.conf"
711

812
$SERVER["socket"] == "0.0.0.0:443" {
9-
ssl.engine = "enable"
13+
ssl.engine = "enable"
1014
}
11-
12-
# support for IPv6 HTTPS via Debian script (in 'lighttpd' package)
1315
include_shell "/usr/share/lighttpd/use-ipv6.pl 443"

overlays/lighttpd/etc/lighttpd/ssl-params.conf

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,38 @@
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
45

56
ssl.pemfile = "/etc/ssl/private/cert.pem"
67
ssl.privkey = "/etc/ssl/private/cert.key"
78
ssl.dh-file = "/etc/ssl/private/dhparams.pem"
89

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")
1513

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 = (
1826
"Strict-Transport-Security" => "max-age=63072000; includeSubdomains; preload",
1927
"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)
2236

2337
# OCSP stapling (input file is maintained by external 'cert-staple.sh' script)
2438
# https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_SSL#OCSP-Stapling

0 commit comments

Comments
 (0)