warn about missing server during ARI checks (#10369)

this is part of https://github.com/certbot/certbot/issues/10336

on my test server, the output of `certbot renew` after deleting the
server field looks like:
<img width="1815" height="398" alt="Screenshot 2025-07-17 at 12 06
07 PM"
src="https://github.com/user-attachments/assets/537bcc39-eb59-43b4-912f-d30ac22baae8"
/>
This commit is contained in:
Brad Warren 2025-07-17 13:17:50 -07:00 committed by GitHub
parent a020de1e50
commit d2e1567d26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -397,8 +397,9 @@ def should_autorenew(config: configuration.NamespaceConfig,
if acme:
renewal_time, _ = acme.renewal_time(cert_pem)
else:
logger.info("Certificate has no 'server' field configured, unable to "
"perform ACME Renewal Information (ARI) request.")
renewal_conf_file = storage.renewal_filename_for_lineagename(config, lineage.lineagename)
logger.warning("Skipping ARI check because %s has no 'server' field. This issue will not "
"prevent certificate renewal", renewal_conf_file)
now = datetime.datetime.now(datetime.timezone.utc)

View file

@ -418,7 +418,11 @@ class RenewalTest(test_util.ConfigTestCase):
mock_ocsp.return_value = True
assert renewal.should_autorenew(self.config, mock_rc, acme_clients)
mock_rc.server = None
assert renewal.should_autorenew(self.config, mock_rc, acme_clients)
with mock.patch('certbot._internal.renewal.logger.warning') as mock_warning:
assert renewal.should_autorenew(self.config, mock_rc, acme_clients)
# Ensure we warned about skipping ARI checks when server is None
assert any(call.args[0].startswith('Skipping ARI') for call in
mock_warning.call_args_list)
@mock.patch('certbot._internal.client.create_acme_client')
@mock.patch('certbot._internal.storage.RenewableCert.ocsp_revoked')