diff --git a/certbot/CHANGELOG.md b/certbot/CHANGELOG.md index 387373fff..cc7e5e78f 100644 --- a/certbot/CHANGELOG.md +++ b/certbot/CHANGELOG.md @@ -17,7 +17,7 @@ Certbot adheres to [Semantic Versioning](https://semver.org/). ### Fixed -* +* Fixed a crash when registering an account with BuyPass' ACME server. More details about these changes can be found on our GitHub repo. diff --git a/certbot/certbot/_internal/account.py b/certbot/certbot/_internal/account.py index 8dcf1de09..e289245b1 100644 --- a/certbot/certbot/_internal/account.py +++ b/certbot/certbot/_internal/account.py @@ -242,11 +242,11 @@ class AccountFileStorage(interfaces.AccountStorage): dir_path = self._prepare(account) self._create(account, dir_path) self._update_meta(account, dir_path) - self._update_regr(account, client, dir_path) + self._update_regr(account, dir_path) except IOError as error: raise errors.AccountStorageError(error) - def update_regr(self, account: Account, client: ClientV2) -> None: + def update_regr(self, account: Account) -> None: """Update the registration resource. :param Account account: account to update @@ -255,7 +255,7 @@ class AccountFileStorage(interfaces.AccountStorage): """ try: dir_path = self._prepare(account) - self._update_regr(account, client, dir_path) + self._update_regr(account, dir_path) except IOError as error: raise errors.AccountStorageError(error) @@ -346,7 +346,7 @@ class AccountFileStorage(interfaces.AccountStorage): with util.safe_open(self._key_path(dir_path), "w", chmod=0o400) as key_file: key_file.write(account.key.json_dumps()) - def _update_regr(self, account: Account, acme: ClientV2, dir_path: str) -> None: + def _update_regr(self, account: Account, dir_path: str) -> None: with open(self._regr_path(dir_path), "w") as regr_file: regr = messages.RegistrationResource( body={}, diff --git a/certbot/certbot/_internal/main.py b/certbot/certbot/_internal/main.py index 0712f1962..316503c5d 100644 --- a/certbot/certbot/_internal/main.py +++ b/certbot/certbot/_internal/main.py @@ -948,7 +948,7 @@ def update_account(config: configuration.NamespaceConfig, # the v2 uri. Since it's the same object on disk, put it back to the v1 uri # so that we can also continue to use the account object with acmev1. acc.regr = acc.regr.update(uri=prev_regr_uri) - account_storage.update_regr(acc, cb_client.acme) + account_storage.update_regr(acc) if not config.email: display_util.notify("Any contact information associated " diff --git a/certbot/tests/account_test.py b/certbot/tests/account_test.py index e0972f247..f00ac363d 100644 --- a/certbot/tests/account_test.py +++ b/certbot/tests/account_test.py @@ -141,7 +141,7 @@ class AccountFileStorageTest(test_util.ConfigTestCase): self.assertEqual(self.acc, loaded) def test_update_regr(self): - self.storage.update_regr(self.acc, self.mock_client) + self.storage.update_regr(self.acc) account_path = os.path.join(self.config.accounts_dir, self.acc.id) self.assertTrue(os.path.exists(account_path)) self.assertTrue(os.path.exists(os.path.join(account_path, "regr.json")))