mirror of
https://github.com/certbot/certbot.git
synced 2026-07-30 16:14:44 +02:00
acme: remove Client and BackwardsCompatibleClientV2 (#9356)
* acme: remove Client and BackwardsCompatibleClientV2 * remove ClientTestBase and some unused variables * add ClientV2.get_directory * tweak ToS callback code * acme: update example to use ClientV2.get_directory * simplify ToS callback further into one step * further removal of acmev1-related code - remove acme.client.ClientBase - remove acme.mixins.VersionedLEACMEMixin - remove acme.client.DER_CONTENT_TYPE - remove various ACMEv1 special cases - remove acme.messages.ChallengeResources.combinations * remove .mixins.ResourceMixin, fields.resource, fields.Resource and resource field from various .message classes. * simplify acme.messages.Directory: - remove Directory.register - remove HasResourceType and GenericHasResourceType - remove ability to look up Directory resources by anything other than the exact field name in RFC8555 (section 9.7.5) * remove acme.messages.OLD_ERROR_PREFIX and support the old prefix * remove acme.mixins * reorder imports * add comment to Directory about resource lookups * s/new-cert/newOrder/ * get rid of `resource` sillyness in tests * remove acmev1 terms-of-service support from directory
This commit is contained in:
@@ -163,7 +163,7 @@ def example_http():
|
||||
# Register account and accept TOS
|
||||
|
||||
net = client.ClientNetwork(acc_key, user_agent=USER_AGENT)
|
||||
directory = messages.Directory.from_json(net.get(DIRECTORY_URL).json())
|
||||
directory = client.ClientV2.get_directory(DIRECTORY_URL, net)
|
||||
client_acme = client.ClientV2(directory, net=net)
|
||||
|
||||
# Terms of Service URL is in client_acme.directory.meta.terms_of_service
|
||||
@@ -215,8 +215,7 @@ def example_http():
|
||||
try:
|
||||
regr = client_acme.query_registration(regr)
|
||||
except errors.Error as err:
|
||||
if err.typ == messages.OLD_ERROR_PREFIX + 'unauthorized' \
|
||||
or err.typ == messages.ERROR_PREFIX + 'unauthorized':
|
||||
if err.typ == messages.ERROR_PREFIX + 'unauthorized':
|
||||
# Status is deactivated.
|
||||
pass
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user