Skip to content

fix(ssl): honor updated le-mail on certificate renewal - #497

Open
mrrobot47 wants to merge 2 commits into
EasyEngine:developfrom
mrrobot47:fix/renewal-honor-le-mail
Open

mrrobot47 wants to merge 2 commits into
EasyEngine:developfrom
mrrobot47:fix/renewal-honor-le-mail

Conversation

@mrrobot47

@mrrobot47 mrrobot47 commented Jun 30, 2026 •

Copy link
Copy Markdown
Member

Problem

On renewal, getOrCreateDistinguishedName() rebuilt the CSR's distinguished name using the stored email (from first issuance) and ignored the le-mail value, and executeRenewal() re-read le-mail from config.yml instead of using the email passed to request(). So after changing le-mail, renewal CSRs and the stored distinguished_name.json kept the original address. Note: Let's Encrypt drops CSR subject fields other than the CN, so the email never appears in issued certificates, and the ACME account contact is not updated by this change (that would need an account update).

Fix

When a stored distinguished name exists, use the passed $email if it is non-empty, falling back to the stored email only when none is provided. The updated DN is persisted as before, so the new email sticks for future renewals. All other DN fields and the SAN list are unchanged.

Testing

Manual: change le-mail, force a renewal → the CSR subject and acme-conf/var/<domain>/distinguished_name.json carry the new email; --le-mail=<x> on ssl-renew is honoured too; with an empty le-mail, the DN falls back to the stored address.

Tested on PHP 7.4 and 8.5 by running the real renewal code against a stub ACME client and capturing the CSR (new, runtime and empty emails), and on Ubuntu 26.04 with EasyEngine 4.12.0 for regressions (self-signed create, ssl-renew --all, ssl-renew on a non-LE site).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

executeRenewal() read le-mail from config.yml directly, so the email passed to request() (the runner config, including a --le-mail runtime override) was ignored on renewal while the first-request path used it. Pass it through instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants