mirror of
https://github.com/certbot/certbot.git
synced 2026-07-31 18:25:24 +02:00
Propagate requirement that ACME responses are UTF-8 (#9001)
I think this fixes https://github.com/certbot/certbot/issues/8968.
The only other calls with `requests` we make in our code outside of our tests that I could find are:
1. [Here](https://github.com/certbot/certbot/blob/a8a8a39ff18ee33936d385b5ac403daa81b7ed31/certbot/certbot/_internal/eff.py#L91) where we assume the response is JSON and I think [requests behavior](https://github.com/psf/requests/blob/db575eeedcfdb03bf31285afd3033e301df8b685/requests/models.py#L891-L896) is sane.
2. [Here](https://github.com/certbot/certbot/blob/a8a8a39ff18ee33936d385b5ac403daa81b7ed31/certbot/certbot/ocsp.py#L190) where we know the response contains binary data.
I think this is a pretty minor change because we were already assuming the response was UTF-8 in the code here when logging it which I think is a valid assumption because the spec says that [all content should be UTF-8 encoded](https://datatracker.ietf.org/doc/html/rfc8555#section-5).
I added the check for the `Accept` header due to the text [here](https://datatracker.ietf.org/doc/html/rfc8555#section-7.4.2) saying that it can be used to request the certificate in an alternate format such as DER. We currently set the Accept header in our own ACMEv1 client code before downloading the DER certificate, but this isn't required according to [the closest thing I think we have to an ACMEv1 spec](https://github.com/letsencrypt/boulder/blob/f1894f8d1d91c250d8193be02cb08b22d849f641/docs/acme-divergences-v1.md#section-742) so I left the content type check with a comment that it can be removed in the future.
* Revert "add chardet dep (#8965)"
This reverts commit 1129d850d3.
* set response.encoding in acme
* more docs
This commit is contained in:
@@ -6,10 +6,6 @@ from setuptools import setup
|
||||
version = '1.19.0.dev0'
|
||||
|
||||
install_requires = [
|
||||
# This dependency just exists to ensure that chardet is installed along
|
||||
# with requests so it will use it instead of charset_normalizer. See
|
||||
# https://github.com/certbot/certbot/issues/8964 for more info.
|
||||
'chardet',
|
||||
'cryptography>=2.1.4',
|
||||
# formerly known as acme.jose:
|
||||
# 1.1.0+ is required to avoid the warnings described at
|
||||
|
||||
Reference in New Issue
Block a user