From 7a9483ca527e8b826a2fbcd0d029af1cd02079bf Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Tue, 17 Nov 2026 09:28:43 +0530 Subject: [PATCH 1/2] fix(site): don't report a manual DNS renewal as completed With preferred_ssl_challenge: dns and no Cloudflare API key, ee site ssl-renew only prints the TXT records and asks for ee site ssl-verify, but still ended with "Success: SSL renewal completed." although no certificate was issued. It now ends with a warning that the renewal is pending until ssl-verify, keeping exit code 0 since the next step is the user's; ssl-renew --all still goes on with the next site. The warning says the current certificate is kept only when the site has one, since ssl-renew --force also gets there for a site still waiting for its first certificate. --- src/helper/class-ee-site.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/helper/class-ee-site.php b/src/helper/class-ee-site.php index f34b1546..debfe3e3 100644 --- a/src/helper/class-ee-site.php +++ b/src/helper/class-ee-site.php @@ -64,6 +64,11 @@ abstract class EE_Site_Command { */ private $ssl_failure_handled_by_caller = false; + /** + * @var bool $le_dns_verify_pending Whether init_le() left a manual DNS challenge for `ee site ssl-verify` to finish. + */ + private $le_dns_verify_pending = false; + /** * @var resource $ssl_lock_handle Handle of the process-wide SSL lock. * @@ -2078,6 +2083,7 @@ protected function init_le( $site_url, $site_fs_path, $wildcard = false, $www_or $api_key_absent = empty( get_config_value( 'cloudflare-api-key' ) ); if ( $is_solver_dns && $api_key_absent ) { echo \cli\Colors::colorize( '%YIMPORTANT:%n Run `ee site ssl-verify ' . $site_url . '` once the DNS changes have propagated to complete the certification generation and installation.', null ) . PHP_EOL; + $this->le_dns_verify_pending = true; } else { if ( ! $api_key_absent && $is_solver_dns ) { EE::log( 'Waiting for DNS entry propagation.' ); @@ -2581,6 +2587,14 @@ public function ssl_renew( $args, $assoc_args ) { } EE::error( $e->getMessage() . $kept ); } + // Without a Cloudflare API key the DNS challenge is manual, so no certificate was issued yet. + if ( $this->le_dns_verify_pending ) { + // `ssl-renew --force` on a site still waiting for its first certificate has none to keep. + $still_kept = \EE\Site\Utils\is_le_ssl_pending( $this->site_data['site_url'], 'le' ) ? '' : ' The current certificate is kept until then.'; + EE::warning( sprintf( 'SSL renewal of %1$s is pending: no new certificate was issued yet. Add the TXT records above and run `ee site ssl-verify %1$s` once they have propagated.%2$s', $this->site_data['site_url'], $still_kept ) ); + + return; + } } EE::success( 'SSL renewal completed.' ); } From 94ccb77be64b501e351eafb89edff2c042b76d2c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Tue, 17 Nov 2026 09:39:06 +0530 Subject: [PATCH 2/2] fix(site): don't assume TXT records were printed in the pending renewal warning When every authorization is already valid, init_le() prints no records but still leaves the certificate to ee site ssl-verify. --- src/helper/class-ee-site.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helper/class-ee-site.php b/src/helper/class-ee-site.php index debfe3e3..761dc0c7 100644 --- a/src/helper/class-ee-site.php +++ b/src/helper/class-ee-site.php @@ -2591,7 +2591,7 @@ public function ssl_renew( $args, $assoc_args ) { if ( $this->le_dns_verify_pending ) { // `ssl-renew --force` on a site still waiting for its first certificate has none to keep. $still_kept = \EE\Site\Utils\is_le_ssl_pending( $this->site_data['site_url'], 'le' ) ? '' : ' The current certificate is kept until then.'; - EE::warning( sprintf( 'SSL renewal of %1$s is pending: no new certificate was issued yet. Add the TXT records above and run `ee site ssl-verify %1$s` once they have propagated.%2$s', $this->site_data['site_url'], $still_kept ) ); + EE::warning( sprintf( 'SSL renewal of %1$s is pending: no new certificate was issued yet. Run `ee site ssl-verify %1$s` once the DNS TXT records have propagated.%2$s', $this->site_data['site_url'], $still_kept ) ); return; }