renewal: use lineage-specific server for ARI (#10307)

Previously, we were constructing an ACME client for ARI checking that
used the global value for `server`, not the one recorded in a lineage's
renewal file.

This resulted in errors in the logs and failure to observe ARI for
lineages that used a non-default `--server` (e.g. staging or non-Let's
Encrypt CAs).

---------

Co-authored-by: ohemorange <ebportnoy@gmail.com>
This commit is contained in:
Jacob Hoffman-Andrews
2025-06-09 11:44:04 -07:00
committed by GitHub
co-authored by ohemorange
parent a75057042f
commit 1d9fc8dccf
5 changed files with 34 additions and 8 deletions
@@ -329,6 +329,13 @@ def test_renew_when_ari_says_its_time(context: IntegrationTestsContext) -> None:
}
}))
# For the renew call only, avoid passing `--server` to the `certbot` command, so
# we fall back on the hardcoded default of `https://acme-v02.api.letsencrypt.org`.
# No requests should be made to that URL because the lineage has a baked-in Pebble
# URL in its config from the issuance earlier in this test case. If there's a bug
# an ARI _is_ called against that URL it will fail because Let's Encrypt doesn't
# know about certificates issued by Pebble.
context.directory_url = None
context.certbot(['renew', '--deploy-hook', misc.echo('deploy', context.hook_probe)],
force_renew=False)
@@ -6,6 +6,7 @@ import subprocess
import sys
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
import certbot_integration_tests
@@ -13,7 +14,7 @@ import certbot_integration_tests
from certbot_integration_tests.utils.constants import *
def certbot_test(certbot_args: List[str], directory_url: str, http_01_port: int,
def certbot_test(certbot_args: List[str], directory_url: Optional[str], http_01_port: int,
tls_alpn_01_port: int, config_dir: str, workspace: str,
force_renew: bool = True) -> Tuple[str, str]:
"""
@@ -81,7 +82,7 @@ def _prepare_environ(workspace: str) -> Dict[str, str]:
return new_environ
def _prepare_args_env(certbot_args: List[str], directory_url: str, http_01_port: int,
def _prepare_args_env(certbot_args: List[str], directory_url: Optional[str], http_01_port: int,
tls_alpn_01_port: int, config_dir: str, workspace: str,
force_renew: bool) -> Tuple[List[str], Dict[str, str]]:
@@ -90,9 +91,12 @@ def _prepare_args_env(certbot_args: List[str], directory_url: str, http_01_port:
if force_renew:
additional_args.append('--renew-by-default')
if directory_url:
additional_args.extend(['--server', directory_url])
command = [
'certbot',
'--server', directory_url,
'--no-verify-ssl',
'--http-01-port', str(http_01_port),
'--https-port', str(tls_alpn_01_port),