|
|
|
@ -21,7 +21,7 @@ version_added: "2.2"
|
|
|
|
|
short_description: Create SSL/TLS certificates with the ACME protocol
|
|
|
|
|
description:
|
|
|
|
|
- "Create and renew SSL/TLS certificates with a CA supporting the
|
|
|
|
|
L(ACME protocol,https://tools.ietf.org/html/draft-ietf-acme-acme-14),
|
|
|
|
|
L(ACME protocol,https://tools.ietf.org/html/rfc8555),
|
|
|
|
|
such as L(Let's Encrypt,https://letsencrypt.org/). The current
|
|
|
|
|
implementation supports the C(http-01), C(dns-01) and C(tls-alpn-01)
|
|
|
|
|
challenges."
|
|
|
|
@ -36,7 +36,7 @@ description:
|
|
|
|
|
the necessary certificate has to be created and served.
|
|
|
|
|
It is I(not) the responsibility of this module to perform these steps."
|
|
|
|
|
- "For details on how to fulfill these challenges, you might have to read through
|
|
|
|
|
L(the main ACME specification,https://tools.ietf.org/html/draft-ietf-acme-acme-14#section-8)
|
|
|
|
|
L(the main ACME specification,https://tools.ietf.org/html/rfc8555#section-8)
|
|
|
|
|
and the L(TLS-ALPN-01 specification,https://tools.ietf.org/html/draft-ietf-acme-tls-alpn-05#section-3).
|
|
|
|
|
Also, consider the examples provided for this module."
|
|
|
|
|
notes:
|
|
|
|
@ -311,7 +311,7 @@ authorizations:
|
|
|
|
|
type: complex
|
|
|
|
|
contains:
|
|
|
|
|
authorization:
|
|
|
|
|
description: ACME authorization object. See U(https://tools.ietf.org/html/draft-ietf-acme-acme-14#section-7.1.4)
|
|
|
|
|
description: ACME authorization object. See U(https://tools.ietf.org/html/rfc8555#section-7.1.4)
|
|
|
|
|
returned: success
|
|
|
|
|
type: dict
|
|
|
|
|
order_uri:
|
|
|
|
@ -496,11 +496,11 @@ class ACMEClient(object):
|
|
|
|
|
keyauthorization = self.account.get_keyauthorization(token)
|
|
|
|
|
|
|
|
|
|
if type == 'http-01':
|
|
|
|
|
# https://tools.ietf.org/html/draft-ietf-acme-acme-14#section-8.3
|
|
|
|
|
# https://tools.ietf.org/html/rfc8555#section-8.3
|
|
|
|
|
resource = '.well-known/acme-challenge/' + token
|
|
|
|
|
data[type] = {'resource': resource, 'resource_value': keyauthorization}
|
|
|
|
|
elif type == 'dns-01':
|
|
|
|
|
# https://tools.ietf.org/html/draft-ietf-acme-acme-14#section-8.4
|
|
|
|
|
# https://tools.ietf.org/html/rfc8555#section-8.4
|
|
|
|
|
resource = '_acme-challenge'
|
|
|
|
|
value = nopad_b64(hashlib.sha256(to_bytes(keyauthorization)).digest())
|
|
|
|
|
record = (resource + domain[1:]) if domain.startswith('*.') else (resource + '.' + domain)
|
|
|
|
@ -577,7 +577,7 @@ class ACMEClient(object):
|
|
|
|
|
'''
|
|
|
|
|
Create a new certificate based on the csr.
|
|
|
|
|
Return the certificate object as dict
|
|
|
|
|
https://tools.ietf.org/html/draft-ietf-acme-acme-14#section-7.4
|
|
|
|
|
https://tools.ietf.org/html/rfc8555#section-7.4
|
|
|
|
|
'''
|
|
|
|
|
csr = pem_to_der(self.csr)
|
|
|
|
|
new_cert = {
|
|
|
|
@ -611,7 +611,7 @@ class ACMEClient(object):
|
|
|
|
|
def _download_cert(self, url):
|
|
|
|
|
'''
|
|
|
|
|
Download and parse the certificate chain.
|
|
|
|
|
https://tools.ietf.org/html/draft-ietf-acme-acme-14#section-7.4.2
|
|
|
|
|
https://tools.ietf.org/html/rfc8555#section-7.4.2
|
|
|
|
|
'''
|
|
|
|
|
content, info = self.account.get_request(url, parse_json_result=False, headers={'Accept': 'application/pem-certificate-chain'})
|
|
|
|
|
|
|
|
|
@ -679,7 +679,7 @@ class ACMEClient(object):
|
|
|
|
|
def _new_order_v2(self):
|
|
|
|
|
'''
|
|
|
|
|
Start a new certificate order (ACME v2 protocol).
|
|
|
|
|
https://tools.ietf.org/html/draft-ietf-acme-acme-14#section-7.4
|
|
|
|
|
https://tools.ietf.org/html/rfc8555#section-7.4
|
|
|
|
|
'''
|
|
|
|
|
identifiers = []
|
|
|
|
|
for domain in self.domains:
|
|
|
|
@ -836,7 +836,7 @@ class ACMEClient(object):
|
|
|
|
|
'''
|
|
|
|
|
Deactivates all valid authz's. Does not raise exceptions.
|
|
|
|
|
https://community.letsencrypt.org/t/authorization-deactivation/19860/2
|
|
|
|
|
https://tools.ietf.org/html/draft-ietf-acme-acme-14#section-7.5.2
|
|
|
|
|
https://tools.ietf.org/html/rfc8555#section-7.5.2
|
|
|
|
|
'''
|
|
|
|
|
authz_deactivate = {
|
|
|
|
|
'status': 'deactivated'
|
|
|
|
|