While developing an ACME client (https://github.com/mc3/serverPKI), using the API from automatoes.acme (https://github.com/candango/automatoes), I’m stuck where I receive a response without certificate key after finalizing the order:
def finalize_order(self, order, csr):
"""
Marks the specified validation as complete.
:param OrderResult order: authorization to be
validated
:return:
"""
response = self.post(order.contents['finalize'], {
'csr': export_certificate_for_acme(csr),
}, kid=self.account.uri)
if response.status_code == 200:
return _json(response)
raise AcmeError(response)
def await_for_order_fulfillment(self, order, timeout=2, iterations=5):
response = self.post_as_get(order.uri, kid=self.account.uri)
iteration_count = 0
while _json(response)['status'] != "valid":
if iteration_count == iterations:
break
time.sleep(timeout)
response = self.post_as_get(order.uri,
kid=self.account.uri)
iteration_count += 1
if _json(response)['status'] in ["valid", "ready"]:
order.certificate_uri = _json(response)['certificate']
if response.status_code == 200:
return _json(response)
raise AcmeError(response)
Instead, I receive this response:
{
'status': 'ready',
'expires': '2020-08-09T10:39:29Z',
'identifiers': [
{'type': 'dns', 'value':'test1.lrau.net'},
{'type': 'dns', 'value': 'test2.lrau.net'}],
'authorizations': [
'https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/12342972',
'https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/12342973'],
'finalize': 'https://acme-staging-v02.api.letsencrypt.org/acme/finalize/12343432/123473776'}
I observed this with cert renewal with additional identifiers and/or different algorithms (mostly now rsa + ec).
If I re-run the programm, I can download the certs w/o problems.
What am I doing wrong?