From 1155e1b0c12d75dfd1b51040407e9c54c57a97d1 Mon Sep 17 00:00:00 2001 From: alexzorin Date: Wed, 29 Mar 2023 02:44:19 +1100 Subject: [PATCH] we dont care --- .../certbot_tests/test_main.py | 21 ++++ certbot/CHANGELOG.md | 107 ++++++++++++++++++ certbot/certbot/_internal/renewal.py | 8 ++ certbot/tests/main_test.py | 4 +- certbot/tests/renewal_test.py | 11 ++ 5 files changed, 149 insertions(+), 2 deletions(-) diff --git a/certbot-ci/certbot_integration_tests/certbot_tests/test_main.py b/certbot-ci/certbot_integration_tests/certbot_tests/test_main.py index 65eca976d..76119c27c 100644 --- a/certbot-ci/certbot_integration_tests/certbot_tests/test_main.py +++ b/certbot-ci/certbot_integration_tests/certbot_tests/test_main.py @@ -921,3 +921,24 @@ def test_preferred_chain(context: IntegrationTestsContext) -> None: with open(conf_path, 'r') as f: assert 'preferred_chain = {}'.format(requested) in f.read(), \ 'Expected preferred_chain to be set in renewal config' + + +def test_ancient_rsa_key_type_preserved(context: IntegrationTestsContext) -> None: + certname = context.get_domain('newname') + context.certbot(['certonly', '-d', certname, '--key-type', 'rsa']) + assert_saved_lineage_option(context.config_dir, certname, 'key_type', 'rsa') + + # Remove `key_type = rsa` from the renewal config to emulate a =v2.0.0 may + have had their RSA certificates inadvertently changed to ECDSA certificates. If desired, + the key type may be changed back to RSA. See the [User Guide](https://eff-certbot.readthedocs.io/en/stable/using.html#changing-a-certificate-s-key-type). +* Deprecated flags were inadvertently not printing warnings since v1.16.0. This is now fixed. + +More details about these changes can be found on our GitHub repo. + +## 2.4.0 - 2023-03-07 + +### Added + +* We deprecated support for the update_symlinks command. Support will be removed in a following + version of Certbot. + +### Changed + +* Docker build and deploy scripts now generate multiarch manifests for non-architecture-specific tags, instead of defaulting to amd64 images. + +### Fixed + +* Reverted [#9475](https://github.com/certbot/certbot/pull/9475) due to a performance regression in large nginx deployments. + +More details about these changes can be found on our GitHub repo. + +## 2.3.0 - 2023-02-14 + +### Added + +* Allow a user to modify the configuration of a certificate without renewing it using the new `reconfigure` subcommand. See `certbot help reconfigure` for details. +* `certbot show_account` now displays the [ACME Account Thumbprint](https://datatracker.ietf.org/doc/html/rfc8555#section-8.1). + +### Changed + +* Certbot will no longer save previous CSRs and certificate private keys to `/etc/letsencrypt/csr` and `/etc/letsencrypt/keys`, respectively. These directories may be safely deleted. +* Certbot will now only keep the current and 5 previous certificates in the `/etc/letsencrypt/archive` directory for each certificate lineage. Any prior certificates will be automatically deleted upon renewal. This number may be further lowered in future releases. + * As always, users should only reference the certificate files within `/etc/letsencrypt/live` and never use `/etc/letsencrypt/archive` directly. See [Where are my certificates?](https://eff-certbot.readthedocs.io/en/stable/using.html#where-are-my-certificates) in the Certbot User Guide. +* `certbot.configuration.NamespaceConfig.key_dir` and `.csr_dir` are now deprecated. +* All Certbot components now require `pytest` to run tests. + +### Fixed + +* Fixed a crash when registering an account with BuyPass' ACME server. +* Fixed a bug where Certbot would crash with `AttributeError: can't set attribute` on ACME server errors in Python 3.11. See [GH #9539](https://github.com/certbot/certbot/issues/9539). + +More details about these changes can be found on our GitHub repo. + +## 2.2.0 - 2023-01-11 + +### Added + +* + +### Changed + +* Certbot will no longer respect very long challenge polling intervals, which may be suggested + by some ACME servers. Certbot will continue to wait up to 90 seconds by default, or up to a + total of 30 minutes if requested by the server via `Retry-After`. + +### Fixed + +* + +More details about these changes can be found on our GitHub repo. + +## 1.32.2 - 2022-12-16 + +### Fixed + +* Our snaps and Docker images were rebuilt to include updated versions of our dependencies. + +This release was not pushed to PyPI since those packages were unaffected. + +More details about these changes can be found on our GitHub repo. + +## 2.1.1 - 2022-12-15 + +### Fixed + +* Our snaps, Docker images, and Windows installer were rebuilt to include updated versions of our dependencies. + +This release was not pushed to PyPI since those packages were unaffected. + +More details about these changes can be found on our GitHub repo. + +>>>>>>> e10e549a9 (renewal: fix key_type not being preserved on =v2.0.0, where the default + # key_type was changed to ECDSA. See https://github.com/certbot/certbot/issues/9635. + renewalparams["key_type"] = renewalparams.get("key_type", "rsa") + # Now restore specific values along with their data types, if # those elements are present. renewalparams = _remove_deprecated_config_elements(renewalparams) diff --git a/certbot/tests/main_test.py b/certbot/tests/main_test.py index e857f6c33..d79b1ad2e 100644 --- a/certbot/tests/main_test.py +++ b/certbot/tests/main_test.py @@ -1323,13 +1323,13 @@ class MainTest(test_util.ConfigTestCase): self._test_renewal_common(True, [], args=args, should_renew=True) def test_reuse_key(self): - test_util.make_lineage(self.config.config_dir, 'sample-renewal.conf') + test_util.make_lineage(self.config.config_dir, 'sample-renewal.conf', ec=False) args = ["renew", "--dry-run", "--reuse-key"] self._test_renewal_common(True, [], args=args, should_renew=True, reuse_key=True) @mock.patch('certbot._internal.storage.RenewableCert.save_successor') def test_reuse_key_no_dry_run(self, unused_save_successor): - test_util.make_lineage(self.config.config_dir, 'sample-renewal.conf') + test_util.make_lineage(self.config.config_dir, 'sample-renewal.conf', ec=False) args = ["renew", "--reuse-key"] self._test_renewal_common(True, [], args=args, should_renew=True, reuse_key=True) diff --git a/certbot/tests/renewal_test.py b/certbot/tests/renewal_test.py index ce6065091..1cc85934e 100644 --- a/certbot/tests/renewal_test.py +++ b/certbot/tests/renewal_test.py @@ -173,6 +173,17 @@ class RenewalTest(test_util.ConfigTestCase): # value in the renewal conf file self.assertIsInstance(lineage_config.manual_public_ip_logging_ok, mock.MagicMock) + @mock.patch('certbot._internal.renewal.cli.set_by_cli') + def test_absent_key_type_restored(self, mock_set_by_cli): + mock_set_by_cli.return_value = False + + rc_path = test_util.make_lineage(self.config.config_dir, 'sample-renewal.conf', ec=False) + + from certbot._internal import renewal + lineage_config = copy.deepcopy(self.config) + renewal.reconstitute(lineage_config, rc_path) + assert lineage_config.key_type == 'rsa' + class RestoreRequiredConfigElementsTest(test_util.ConfigTestCase): """Tests for certbot._internal.renewal.restore_required_config_elements."""