Commit graph

604 commits

Author SHA1 Message Date
Erica Portnoy
1ee73eed10 Bump version to 5.4.0 2026-02-03 09:52:18 -08:00
Erica Portnoy
54a3078305
Release 5.3.0 2026-02-03 09:52:16 -08:00
ohemorange
b362109bf6
Fix certbot tests after updating pytest to 9.0.2 (#10545)
Fixes  #10518.

`tools/pinning/current/repin.sh` is not run; only pytest version is
updated. This is because `pypinning` had a bunch of syntax changes that
seem simply but I believe should be in a separate PR, which I think
should be done after this to collect all repin changes.

As discussed further in #10518, these issues were caused by pytest's
internalization of pytest-subtest, which had several implementation
changes.

To fix these, we simply no longer use subtest in the failing tests. The
test in acme is now parametrized instead, and the tests in apache only
ever had a single parameter.

To use parametrization in the acme test, I converted `DNSTest` from
unittest to pytest style, which was pretty straightforward. The only
note there is that while it would be nice to make `ec_secp384r1_key` a
fixture, you [can't use fixtures in
parameters](https://github.com/pytest-dev/pytest/issues/349). You could
use requests, but that seemed less clear and messier, because then you'd
be checking the value of the parameter and only sometimes loading it.
Could also make it a global variable, but that didn't really seem
necessary, as it's only called twice. Happy to consider other options,
not strongly tied to this one, just seemed nicest to me.
2026-02-02 12:13:24 -08:00
Jacob Hoffman-Andrews
58724f68ec
Add CLI flag --ip-address (#10495)
Co-authored-by: ohemorange <ebportnoy@gmail.com>
Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
2026-01-16 13:23:41 -08:00
Brad Warren
28abca467b
remove email address (#10533)
this is the followup from https://github.com/certbot/josepy/pull/254
doing the same thing on this repo

i personally don't think this PR needs two reviews
2026-01-07 19:03:03 +00:00
Jacob Hoffman-Andrews
b1cf53ff6b
Add identifier field to AnnotatedChallenge subclasses (#10491)
This field is optional to maintain backwards compatibility. Note that
`AnnotatedChallenge` inherits from `jose.ImmutableMap`, which has a
[check in
__init__](4b74747670/src/josepy/util.py (L125-L131))
that all slots are provided. That check would not allow us to do a
backwards-compatible addition, so I implemented an `__init__` for each
of these subclasses that fills the fields without calling the parent
`__init__`, and so doesn't hit an error when `identifier` is absent.

I chose to use `acme.messages.Identifier` rather than
`certbot._internal.san.SAN` here because these are wrapped ACME types,
so they should use the ACME representation. Also, `AnnotatedChallenge`
is passed to plugins, so we need to pass a type that the plugins can
understand.

Additionally, `domain` is marked as deprecated.

Part of #10346

/cc @bmw, who noticed the issue with `AnnotatedChallenge`
[here](https://github.com/certbot/certbot/pull/10468#issuecomment-3403294394)
and provided additional feedback
[here](https://github.com/jsha/certbot/pull/2#issuecomment-3534895793).
Note that there's still some work to do to finish excising `domain`
assumptions from this portion of the code.

---------

Co-authored-by: ohemorange <ebportnoy@gmail.com>
2025-12-05 13:44:04 -08:00
Brad Warren
9a2e508348 Bump version to 5.3.0 2025-12-03 11:48:10 -08:00
Brad Warren
1127ac1cd7
Release 5.2.1 2025-12-03 11:48:09 -08:00
Jason Owen
6e489cdb74
Remove vhost_combined override from Apache conf (#10486)
The Apache configuration `Include`d in automatically created
`[sitename]-le-ssl.conf` files was redefining the `vhost_combined`
`LogFormat`, but contrary to the comment before the redefinition, did
not include the virtual host server name in the log format. This is
particularly confusing because this redefinition is hard to find when
debugging logging issues, as log formats are not related to SSL/TLS
configuration, and the included configuration file is outside of
`/etc/apache2`.

Additionally, a `vhost_common` `LogFormat` was defined, but not used
anywhere.

The `LogFormat` directives were introduced in commit
68f85d9f1a. Several other directives that
do not directly pertain to configuring SSL/TLS were added in that
commit, and have gradually been removed over the years. This should be
the last such removal.

Delete the `LogFormat` directives from the Apache configuration files
(both old and current), and update the `ALL_SSL_OPTIONS_HASHES`.

Fixes #9769 File 'options-ssl-apache.conf' included in autocreated
'[sitename]-le-ssl.conf' has potentially problematic vhost_combined
LogFormat
2025-11-26 09:03:31 -08:00
ohemorange
2ec8320763
Add python 3.14 support (#10481)
fixes https://github.com/certbot/certbot/issues/10477. this is based on
the PR that did this for 3.13 at
https://github.com/certbot/certbot/pull/10164
2025-11-04 10:49:51 -08:00
Erica Portnoy
3683eb6cf4 Bump version to 5.2.0 2025-10-07 09:42:29 -07:00
Erica Portnoy
d97f2aefc3
Release 5.1.0 2025-10-07 09:42:28 -07:00
Brad Warren
8ecd7fc23d Bump version to 5.1.0 2025-09-02 08:47:05 -07:00
Brad Warren
c307f62114
Release 5.0.0 2025-09-02 08:47:04 -07:00
ohemorange
5c30a180a2
Apache config update (#10443)
Part of https://github.com/certbot/certbot/issues/10183

There are two changes made here:

1. Add `DHE-RSA-CHACHA20-POLY1305` to `SSLCipherSuite` list. Nice to
have for compliance reasons. See
https://github.com/mozilla/server-side-tls/issues/285 DHE ciphers in
general are the topic of
[some](https://github.com/mozilla/server-side-tls/issues/268)
[debate](https://github.com/mozilla/server-side-tls/issues/299) over on
the generator repo; my opinion is that certbot should match whatever
they currently recommend, and if they do decide to change it, we can
also update to match them again later.
2. Configure curves with `SSLOpenSSLConfCmd`. Needed for OpenSSL 3.0
support, so FFDH won't be used. This option requires apache `>=2.4.8`
but we already require `>=2.4.11` to use this conf file in the first
place, so that's fine. When the file in their repo was converted from
`.hbs` to `.js` the version requirement was changed to `>=2.4.11` but I
suspect that's a bug, and either way it's still fine. See
https://github.com/mozilla/ssl-config-generator/issues/270 and
https://github.com/mozilla/ssl-config-generator/pull/297

You can see a generated Apache config file here:
https://ssl-config.mozilla.org/#server=apache&version=2.4.60&config=intermediate&openssl=3.4.0&guideline=5.7

Originally, I had planned to switch `SSLProtocol` list to allowlist
format. It's a little nicer, though it did the same thing, technically,
and would let us match mozilla, who does this because it makes their
code cleaner. See
https://github.com/mozilla/ssl-config-generator/pull/286/. But TLSv1.3
is only
[supported](https://github.com/mozilla/ssl-config-generator/blob/master/src/js/configs.js#L12C5-L12C21)
in `apache >= 2.4.36`, so we on the other hand would have to include it
conditionally. Whereas despite `SSLv2` [not being
available](https://github.com/mozilla/ssl-config-generator/pull/286/files#diff-3d067ee1b10453909ca9c86397a6b235fcb961ed3ca1cfbdda4daa2cb4b30b97L41)
in `apache >= 2.3.16`, it still recognizes it just fine in a config.
We're always `>= 2.3.16` now so we could remove it proactively, I
suppose, in case apache stops recognizing it. I left it as-is here but
could change it.
2025-08-27 16:38:08 -07:00
Brad Warren
444e3251bf
make apache tls warning conditional (#10444)
this is in response to the thread at
https://opensource.eff.org/eff-open-source/pl/49gnrcner7gptrnsi339bqu1yo
2025-08-25 10:19:18 -07:00
ohemorange
56da12207b
Mock time.sleep for more modules to speed up tests (#10427)
The extra 8 seconds isn't really relevant in the test farm, but is nice
to have for local runs. This is based on what was done in
https://github.com/certbot/certbot/pull/10419/.
2025-08-18 09:59:55 -07:00
ohemorange
d5dd8e47e1
Set up released packages minus dns plugins to use pyproject.toml (#10417)
Part of https://github.com/certbot/certbot/issues/10403.

As far as I can tell, "stick it in setup.py" is the official way of
handling complex dependencies. But since the version is static, we have
a little more choice here than we had with `certbot/pyproject.toml`.

We could put the version in the respective `pyproject.toml`s and read it
directly from the toml file with something like
[this](https://stackoverflow.com/a/78082561). Or otherwise load and
parse that file. The benefit of doing it that way is that all
non-certbot versions would be canonically in the `pyproject.toml`, and
also if we wanted we could use that same toml parsing to change the
version at release time instead of `sed`. I actually suspect `acme`,
`certbot-ci`, and `certbot-compatibility-test` will be the only ones
where we can completely delete `setup.py`, as the others all have
lockstep dependencies. (side note - we just never update `certbot-ci`
version. it's still set at `0.32.0.dev0`. there's no way this matters
but just noting.) I chose to do it this way instead because it seems
cleaner since we have to keep `setup.py` around anyway, but I don't have
a strong preference.

Based on what I've read, there's not actually a clean way to grab and
insert the version number within the toml file. This is due to [design
decisions](https://github.com/toml-lang/toml/issues/77) by the toml
authors. The clean `all` extras specification that we used in
`certbot/pyproject.toml` [seems to be an
outlier](https://github.com/pypa/setuptools/discussions/3627#discussioncomment-6476654)
because it's pip handling the self-reference, not toml.
2025-08-15 08:33:16 -07:00
ohemorange
454048f2f6
Fix memory leak in apache unit tests (#10421)
This was causing oldest tests to fail on my mac, which has an open file
limit of 256. Locks were being released at exit, but there were more
than 256 tests being run at once. Holding onto the file descriptor for
temporary files was making us keep the files open.

I also removed unnecessary setUps and tearDowns in subclasses so that
this could be fixed in only one spot.

If you wanted to do any testing locally, I was throwing this in places:
```
import errno, os, resource
open_file_handles = []
for fd in range(resource.getrlimit(resource.RLIMIT_NOFILE)[0]):
    try: os.fstat(fd)
    except OSError as e:
        if e.errno == errno.EBADF: continue
    open_file_handles.append(fd)
print(f'location description: {len(open_file_handles)}')
```
2025-08-14 17:13:33 -07:00
Brad Warren
27b344c8d8
use pep585 types in certbot-apache (#10413)
this is another part of https://github.com/certbot/certbot/issues/10195

these changes were done automatically with the command:

```
ruff check --fix --extend-select UP006 --unsafe-fixes certbot-apache
```
2025-08-12 15:36:02 -07:00
ohemorange
5d05984dd9
remove python 3.9 support (#10406)
Fixes https://github.com/certbot/certbot/issues/10389. you can compare
this to the PR that did this for python 3.8 at
https://github.com/certbot/certbot/pull/10077

additional changes:
- linux-py310 test is removed from extended tests, since it's now run in
standard tests. additionally, openssl will never be < 1.1.1 now, due to
https://peps.python.org/pep-0644/.
- `letstest/scripts/test_openssl_version.py` was testing functionality
that was removed in https://github.com/certbot/certbot/pull/10373 so it
was deleted

---------

Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
2025-08-12 17:49:02 +00:00
ohemorange
dea3e5f1c4
Set up ruff so that test files have at least some linting (#10399)
Alternative implementation for #7908.

In this PR:
- set up ruff in CI (add to `tox.ini`, mark dep in `certbot/setup.py`)
- add a `ruff.toml` that ignores particularly annoying errors. I think
line length isn't actually necessary to set with this workflow since
we're not checking it but putting it there for future usage.
- either fix or ignore the rest of the errors that come with the default
linting configuration. fixed errors are mostly unused variables. ignored
are usually where we're doing weird import things for a specific reason.
2025-08-08 08:48:43 -07:00
ohemorange
5859e50e44
Run ruff to fix test errors (#10398)
This is mostly removing unused imports, plus one unused `import as`. Had
to put back imports being used with `eval` -- see the second commit.
2025-08-07 22:10:02 +00:00
Erica Portnoy
ffb2196e21 Bump version to 5.0.0 2025-08-05 08:58:17 -07:00
Erica Portnoy
832d11a63f
Release 4.2.0 2025-08-05 08:58:16 -07:00
Brad Warren
ae2a00bbad
prep for 4.2.0 and fix changelog (#10375)
something weird happened to the changelog in
https://github.com/certbot/certbot/pull/10319. a 4.2.0 entry was added
below the entry for `5.0.0 - main` despite 4.2.0 not having been
released. since it's sounding like we're expecting our next release to
be 4.2.0 and not 5.0, i merged these two changelog entries into one for
4.2.0

i also modified our setup.py files to use 4.2.0.dev0 instead of
5.0.0.dev0 altho this isn't strictly necessary because our release
script will automatically set all version numbers to whatever version we
give it on the command line before building the release
2025-07-29 14:44:39 -07:00
ohemorange
d8acf7cea0
Add note and warning about old-options-ssl-apache.conf not receiving updates (#10373)
Part of #10183

> Option 4. Stop updating old files with security improvements. If
people want to be on old software they can but then they're not getting
the nice new things. We can either warn or not warn if we see people
using them, either on certbot install (what, who's installing new
certbot on these machines), new cert, cert renewal, or certbot update.
The second two would require code changes, I'm pretty sure. I don't
think we should warn too often because that's how we get people to
silence all output. This is a little weird because we don't usually keep
around deprecated things. We could also warn loudly and see if people
complain. Or do some sort of brownout.

This PR warns every time certbot is run. We could make it run less often
(only when a new config file is installed, probably), but that's a more
extensive code change, and honestly I think it's probably fine? But I
can change it.
2025-07-25 12:05:58 -07:00
Yaroslav Halchenko
86f76cd3df
Add codespell support (CI to check, not to fix) and make it fix a few typos (#10297)
Another token of gratitude for a super useful tool and service.

More about codespell: https://github.com/codespell-project/codespell .

I personally introduced it to dozens if not hundreds of projects already
and so far only positive feedback.

CI workflow has 'permissions' set only to 'read' so also should be safe.

---------

Signed-off-by: Yaroslav O. Halchenko <debian@onerussian.com>
2025-06-24 13:14:31 +09:00
Erica Portnoy
4a1a136fcb Bump version to 5.0.0 2025-06-10 14:43:36 -07:00
Erica Portnoy
6a72811a39
Release 4.1.0 2025-06-10 14:43:35 -07:00
Brad Warren
cc08242abc
update pinned dependencies (#10278)
this fixes the security alerts those with access can see at
https://github.com/certbot/certbot/security/dependabot

i based what needed to be done to drop python < 3.9.2 support on
https://github.com/certbot/certbot/pull/10077 and concluded we only
really needed to update `python_requires`. we could do a deprecation
period for this, but i think it's not necessary. cryptography didn't
(it's not even in mentioned in [their
changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst))
and none of the major LTS distros use python 3.9.0 or 3.9.1
2025-05-06 10:56:19 -07:00
ohemorange
16f858547f
Add --use-pep517 flag to pip to silence warning in tools/venv.py, and switch codebase to src-layout (#10249)
Fixes #10252.

See further discussion here: https://github.com/pypa/pip/issues/11457

We are doing option:

> Alternatively, enable the --use-pep517 pip option, possibly with
--no-build-isolation. The --use-pip517 flag will force pip to use the
modern mechanism for editable installs. --no-build-isolation may be
needed if your project has build-time requirements beyond setuptools and
wheel. By passing this flag, you are responsible for making sure your
environment already has the required dependencies to build your package.
Once the legacy mechanism is removed, --use-pep517 will have no effect
and will essentially be enabled by default in this context.

Major changes made here include:
- Add `--use-pep517` to use the modern mechanism, which will be the only
mechanism in future pip releases
- Change to `/src` layout to appease mypy, and because for editable
installs that really is the normal way these days.
  - `cd acme && mkdir src && mv acme src/` etc.
- add `where='src'` argument to `find_packages` and add
`package_dir={'': 'src'},` in `setup.py`s
  - update `MANIFEST.in` files with new path locations 
- Update our many hardcoded filepaths
- Update `importlib-metadata` requirement to fix
double-plugin-entry-point problem in oldest tests
2025-04-11 19:30:33 +00:00
Will Greenberg
f822602fff Bump version to 4.1.0 2025-04-07 15:04:01 -07:00
Will Greenberg
d95a389c3f
Release 4.0.0 2025-04-07 15:04:00 -07:00
ohemorange
aa005f20fe
Add RewriteEngine on directive also in post (#10232)
Fixes
https://github.com/certbot/certbot/issues/9835#issuecomment-2717096178,
where our `RewriteEngine on` directive inserted at the beginning of a
virtualhost was overridden a `RewriteEngine Off` directive later. This
PR does the easy thing of placing `RewriteEngine on` in our
post-insert.
2025-03-17 20:02:10 +00:00
Will Greenberg
8a2ded2d0e psych, actually bump version to 4.0.0 2025-02-11 15:17:56 -08:00
Will Greenberg
77594d7300 Bump version to 3.3.0 2025-02-11 11:58:46 -08:00
Will Greenberg
a0e8b49057
Release 3.2.0 2025-02-11 11:58:44 -08:00
ohemorange
a57b29a276
[apache] Add type hints to apache configurator for mypy --strict (#10155)
I don't love the `Any` in that `Callable`, but I can't find a way to fix
it. In practice, it's either going to be `str` or `None`, but we pass an
`options` that's typed as `List[str] | str | None`, and one of the
functions has a header with a strict `str`. I tried various unions of
things and it wasn't working and I decided it's not worth it.

```
$ mypy --strict certbot-apache/certbot_apache/_internal/configurator.py 
Success: no issues found in 1 source file
```
2025-02-06 10:54:10 -08:00
ohemorange
d5cb89ba13
[apache] Add type hints to apache test utils (to enable mypy --strict) (#10151)
We could also leave the `jose.JWKRSA` call as-is and add
`--implicit-reexport`, or explicitly export `JWKRSA` in `josepy`, but I
think just cleaning the calls up is nice.

```
$ mypy --strict certbot-apache/certbot_apache/_internal/tests/util.py
Success: no issues found in 1 source file
```
2025-01-29 15:10:31 -08:00
Brad Warren
392467609f
add python 3.13 support (#10164)
fixes https://github.com/certbot/certbot/issues/10045. this is based on
the PR that did this for 3.12 at
https://github.com/certbot/certbot/pull/9852

this PR also removes python 3.8 from our tox config which should have
been done as part of https://github.com/certbot/certbot/pull/10077
2025-01-29 12:53:56 -08:00
ohemorange
f94c981dfd
[apache] Add type hints to apache obj and http_01 for mypy --strict (#10154)
```
$ mypy --strict certbot-apache/certbot_apache/_internal/http_01.py 
Success: no issues found in 1 source file
$ mypy --strict certbot-apache/certbot_apache/_internal/obj.py 
Success: no issues found in 1 source file
```

PEP 526 says to declare types of unpacked tuples beforehand:
https://peps.python.org/pep-0526/#global-and-local-variable-annotations.
Could have just declared it in apache, but improved the acme return type
while I was at it.

Once again, `typing.Pattern` is deprecated in favor of `re.Pattern` so
changing that while parametrizing the type
2025-01-28 16:33:12 -08:00
Brad Warren
f0f3cdad9c
fixup fromstring return types (#10162)
in https://github.com/certbot/certbot/pull/9124 we had the problem of
certbot-nginx's `Addr.fromstring` method possibly returning None which
is not possible in the `Addr` method in the certbot base class or in
certbot-apache. we fixed this by telling mypy the common
`Addr.fromstring` method returns an `Optional[Addr]` (despite it
actually always returning an `Addr`) and then unnecessarily complicating
certbot-apache's code a bit. the need for extra complexity with this
approach is going even further in
https://github.com/certbot/certbot/pull/10151 where we have to use
`cast` to assure mypy that the type isn't actually `Optional`. i
personally don't like all this
2025-01-28 16:29:52 -08:00
ohemorange
e657cc3a8d
[apache] Add type hints to apache parser.py (to enable mypy --strict) (#10152)
```
$ mypy --strict certbot-apache/certbot_apache/_internal/parser.py 
Success: no issues found in 1 source file
```

`typing.Pattern` is deprecated in python 3.9 in favor of using
`re.Pattern` directly, and also wants to be subscripted with its type.

`python-augeas` types can be found in
a1e84a7e58/augeas/__init__.py
2025-01-28 10:54:11 -08:00
ohemorange
60b88a3b83
[apache] Add type hints to apache dualparser.py (to enable mypy --strict) (#10153)
`typing.Type` is deprecated in favor of built-in `type`. In strict
mode,`find_ancestors` needs to be more specific about what it actually
returns, due to covariance and generics and such.

```
$ mypy --strict certbot-apache/certbot_apache/_internal/dualparser.py 
Success: no issues found in 1 source file
```
2025-01-27 14:54:40 -08:00
Erica Portnoy
1de966d637 Bump version to 3.2.0 2025-01-07 12:54:01 -08:00
Erica Portnoy
dcd52b0711
Release 3.1.0 2025-01-07 12:54:00 -08:00
Mads Jensen
57b5942fc3 Replace aliased OSError.
As of Python 3.3, various errors were merged into OSError.
https://docs.python.org/3/library/exceptions.html#OSError
2024-12-14 11:15:26 +01:00
Brad Warren
7a48c235a9
remove importlib_resources (#10076)
this is part of my work on
https://github.com/certbot/certbot/issues/10035 based on erica's comment
at
https://github.com/certbot/certbot/issues/10035#issuecomment-2452212686
2024-12-06 12:37:17 -08:00
Mads Jensen
3f9387bd15
Fix F541 and E711 (#10071)
There are a quite a lot of imports that are unused.

F541 is Unnecessary f-interpolation without placeholders
E711 is incorrect use of == for boolean and None comparisons

## Pull Request Checklist

- [x] The Certbot team has recently expressed interest in reviewing a PR
for this. If not, this PR may be closed due our limited resources and
need to prioritize how we spend them.
- [ ] If the change being made is to a [distributed
component](https://certbot.eff.org/docs/contributing.html#code-components-and-layout),
edit the `main` section of `certbot/CHANGELOG.md` to include a
description of the change being made.
- [ ] Add or update any documentation as needed to support the changes
in this PR.
- [x] Include your name in `AUTHORS.md` if you like.

---------

Co-authored-by: Mads Jensen <atombrella@users.noreply.github.com>
2024-12-05 11:33:09 -08:00