Skip to content

Fix --webroot-path action (#10509) - #10510

Merged
wgreenberg merged 1 commit into
5.2.xfrom
5.2.2-backport
Dec 10, 2025
Merged

wgreenberg merged 1 commit into
5.2.xfrom
5.2.2-backport

Conversation

@wgreenberg

Copy link
Copy Markdown
Collaborator

Cherry-picks #10509 which fixes #10506. This will eventually make its way into the 5.2.2 point release

Fixes #10506.

When --webroot-path was specified multiple times, Certbot was erroring
with `DNSName SAN compared to non-SAN`. That's because, in the
_WebrootPathAction that builds `namespace.webroot_path`, we were passing
`domain` (type `san.DNSName`) as the keys. The other code that modifies
or accesses `namespace.webroot_path` expects the keys to be of type
`str`. In particular `webroot.Authenticator._set_webroots` does:

```python
            for achall in achalls:
                self.conf("map").setdefault(achall.domain, webroot_path)
```

Where `achall.domain` is a `str`.

Two existing unittests would have caught this: `test_multiwebroot` and
`test_webroot_map_partial_without_perform`. However, they faked out the
parsing of the `--domains` flag, and that faked out code was not updated
in #10468. Since this bug is caused by an interaction between the types
produced by the `--domains` flag and those produced by the
`--webroot-path` flag, the tests failed to catch the problem. I've
updated the tests and confirmed that they fail before the fix is
applied.
@wgreenberg
wgreenberg requested review from bmw and ohemorange December 10, 2025 16:19

@bmw bmw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect. thanks man

imo, this PR is straightforward enough for you to merge with 1 review. if you agree, feel free to hit merge, otherwise, you can wait for ohemorange's review

@wgreenberg
wgreenberg merged commit 305ebe1 into 5.2.x Dec 10, 2025
18 checks passed
@wgreenberg
wgreenberg deleted the 5.2.2-backport branch December 10, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants