mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 19:02:52 +02: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:
@@ -397,8 +397,9 @@ def should_autorenew(config: configuration.NamespaceConfig,
|
|||||||
if acme:
|
if acme:
|
||||||
renewal_time, _ = acme.renewal_time(cert_pem)
|
renewal_time, _ = acme.renewal_time(cert_pem)
|
||||||
else:
|
else:
|
||||||
logger.info("Certificate has no 'server' field configured, unable to "
|
renewal_conf_file = storage.renewal_filename_for_lineagename(config, lineage.lineagename)
|
||||||
"perform ACME Renewal Information (ARI) request.")
|
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)
|
now = datetime.datetime.now(datetime.timezone.utc)
|
||||||
|
|
||||||
|
|||||||
@@ -418,7 +418,11 @@ class RenewalTest(test_util.ConfigTestCase):
|
|||||||
mock_ocsp.return_value = True
|
mock_ocsp.return_value = True
|
||||||
assert renewal.should_autorenew(self.config, mock_rc, acme_clients)
|
assert renewal.should_autorenew(self.config, mock_rc, acme_clients)
|
||||||
mock_rc.server = None
|
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.client.create_acme_client')
|
||||||
@mock.patch('certbot._internal.storage.RenewableCert.ocsp_revoked')
|
@mock.patch('certbot._internal.storage.RenewableCert.ocsp_revoked')
|
||||||
|
|||||||
Reference in New Issue
Block a user