ACME exception fixes (#217)

* Fix wrong usages of ACMEProtocolException.

* Add changelog fragment.

* Fix error handling when content could not be decoded.

* Make sure that content_json is a dict or None.

* Improve acme_inspect's ACMEProtocolException handling.

* Improve error handling.

* Add tests.

* Fix challenge error.

* Add challenges tests.

* Provide content if available.

* Add some order tests.

* Linting.
This commit is contained in:
Felix Fontein
2021-04-11 14:44:44 +02:00
committed by GitHub
parent 7b1d4770e9
commit 0e1f0fd730
12 changed files with 778 additions and 47 deletions

View File

@@ -99,7 +99,9 @@ class Order(object):
if self.status != 'valid':
raise ACMEProtocolException(
'Failed to wait for order to complete; got status "{status}"'.format(status=self.status), content_json=self.data)
client.module,
'Failed to wait for order to complete; got status "{status}"'.format(status=self.status),
content_json=self.data)
def finalize(self, client, csr_der, wait=True):
'''
@@ -121,5 +123,7 @@ class Order(object):
self.refresh(client)
if self.status not in ['procesing', 'valid', 'invalid']:
raise ACMEProtocolException(
'Failed to finalize order; got status "{status}"'.format(
status=self.status), info=info, content_json=result)
client.module,
'Failed to finalize order; got status "{status}"'.format(status=self.status),
info=info,
content_json=result)