fix(ssl): validate le-mail before letsencrypt registration#496
Open
mrrobot47 wants to merge 1 commit into
Open
fix(ssl): validate le-mail before letsencrypt registration#496mrrobot47 wants to merge 1 commit into
mrrobot47 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Let's Encrypt account email (
le-mail) was resolved with a??fallback that only guards null/unset — an empty string passed straight through to ACMEregister()/request(), producing a generic, confusing ACME failure. This affectedinit_le,ssl_verify, andssl_renew.Fix
Add a shared
get_validated_le_mail()helper: resolve from config (or prompt interactively), validate non-empty +filter_var( …, FILTER_VALIDATE_EMAIL ), and hard-error with a clear message (Set it with \ee config set le-mail `.`) when it can't be resolved (e.g. non-interactive cron with no le-mail set). All three sites route through it.In the renewal path the email is resolved after the
'le'/'inherit'site-type guard inrenew_ssl_cert(), so a non-LE single-sitessl-renewstill gets the accurate "Only Letsencrypt certificate renewal is supported." error rather than an email error.Testing
Manual: with
le-mailunset/garbage, a non-interactive LE issuance/renew now exits cleanly with the "valid email required" message instead of an opaque ACME error; a validle-mailproceeds as before; a non-LEssl-renewstill reports the site-type error.