mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
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:
parent
a020de1e50
commit
d2e1567d26
2 changed files with 8 additions and 3 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in a new issue