Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dietpi-letsencrypt, bug introduced with my last commit #6517

Merged
merged 3 commits into from Jul 30, 2023

Conversation

JappeHallunken
Copy link
Contributor

there can only be one "options" line, otherwise lighttpd fails to restart after running dietpi-letsencrypt

https://dietpi.com/forum/t/lighttpd-fails-after-renewing-letsencrypt/17510/6

@JappeHallunken
Copy link
Contributor Author

JappeHallunken commented Jul 30, 2023

Maybe we now can even delete the line sed -i 's/, "Options" => "-SessionTicket"//' /etc/lighttpd/conf-available/50-dietpi-https.conf which was for bullseye installations, but the line won't be in the file now anyways, so this is obsolete?

Bullseye: Install dedicated TLS module package and keep session tickets enabled, which is safe since Lighttpd v1.4.56: #4294 (comment)

@MichaIng
Copy link
Owner

MichaIng commented Jul 30, 2023

Dammit.

There is this Bullseye+ block below to remove the option anyway, but it is not correctly applied after the last change. Let's do like this:

		"Options" => "-ServerPreference,-SessionTicket",
		"CipherString" => "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305"
	)
}
_EOF_
			# Bullseye: Install dedicated TLS module package and keep session tickets enabled, which is safe since Lighttpd v1.4.56: https://github.com/MichaIng/DietPi/issues/4294#issuecomment-826802056
			if (( $G_DISTRO > 5 ))
			then
				G_AG_CHECK_INSTALL_PREREQ lighttpd-mod-openssl
				G_EXEC sed -i 's/,-SessionTicket//' /etc/lighttpd/conf-available/50-dietpi-https.conf
			fi

Syntax for multiple options comma-separated taken from here: https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_SSL#Perfect-Forward-Secrecy-PFS

EDIT:

which was for bullseye installations

We need to keep this as long as we still do support Buster. I would love to drop support for it soon, but there are still 6% Debian Buster based DietPi systems. I think we again need to wait until the end of the year for this step.

@MichaIng
Copy link
Owner

MichaIng commented Jul 30, 2023

The dash negates the individual option. What we want is that clients choose the cipher (from those supported by the server/part of the list) and disable session tickets on Buster. See "Options" syntax here: https://www.openssl.org/docs/manmaster/man3/SSL_CONF_cmd.html#Options

@JappeHallunken JappeHallunken marked this pull request as ready for review July 30, 2023 19:57
@JappeHallunken
Copy link
Contributor Author

yeah I read the manpage also in the meantime and deleted my comment before I saw yours :)

JappeHallunken and others added 3 commits July 30, 2023 22:09
there can only be one "options" line, otherwise lighttpd fails to restart after running dietpi-letsencrypt

https://dietpi.com/forum/t/lighttpd-fails-after-renewing-letsencrypt/17510/6
- CHANGELOG | DietPi-LetsEncrypt: Resolved a v8.20 regression where Lighttpd did not start after applying or renewing the certificate due to a syntax error. Many thanks to @JappeHallunken for fixing this issue: MichaIng#6517
@MichaIng
Copy link
Owner

We really need to implement an option to apply a self-signed certificate. This would make it so much easier to test everything, also in an automated way via GitHub Actions workflow. I am often too lazy to switch back and forth port forwarding from my production home server to some test system to test dietpi-letsencrypt properly. And also Let's Encrypt has rate limiting which I fear to run into 🙄.

@MichaIng MichaIng merged commit f015407 into MichaIng:dev Jul 30, 2023
1 check passed
@Joulinar
Copy link
Collaborator

do we need to push an updated version or patch? because we have another user on the forum and I have the feeling it will be more until next release in 4 weeks.

@MichaIng
Copy link
Owner

I'll push a live patch today.

MichaIng added a commit that referenced this pull request Jul 31, 2023
- Live patch 0 | Fix DietPi-LetsEncrypt SSL config for Lighttpd: #6517
MichaIng added a commit that referenced this pull request Jul 31, 2023
- Live patch 0 | Fix DietPi-LetsEncrypt SSL config for Lighttpd: #6517
@MichaIng
Copy link
Owner

Done: #6522

@gstrauss
Copy link

gstrauss commented Aug 9, 2023

And also Let's Encrypt has rate limiting which I fear to run into 🙄.

FYI: you can avoid Let's Encrypt rate limits on their production servers by using Let's Encrypt staging servers: https://letsencrypt.org/docs/staging-environment/

@MichaIng
Copy link
Owner

MichaIng commented Aug 9, 2023

Good to know something like this exist, also since this means I do not need to issue a real certificate to test the script. However, best would be a self-signed cert option, to allow automating the tests here on GitHub where runners are not publicly reachable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants