Skip to content
Permalink
Browse files

Add comments.

  • Loading branch information...
felixfontein committed Aug 17, 2019
1 parent b935712 commit 64196c934cb82e95849c90666b35052f32b68e1c
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/ansible/modules/crypto/acme/acme_certificate.py
@@ -996,6 +996,9 @@ def finish_challenges(self):
self._validate_challenges(identifier_type, identifier, auth)

def _chain_matches(self, chain, criterium):
'''
Check whether an alternate chain matches the specified criterium.
'''
if criterium['test_certificates'] == 'last':
chain = chain[-1:]
for cert in chain:
@@ -1067,6 +1070,7 @@ def get_certificate(self):
cert_uri = self._finalize_cert()
cert = self._download_cert(cert_uri)
if self.module.params['retrieve_all_alternates'] or self.module.params['select_alternate_chain']:
# Retrieve alternate chains
alternate_chains = []
for alternate in cert['alternates']:
try:
@@ -1076,6 +1080,7 @@ def get_certificate(self):
continue
alternate_chains.append(alt_cert)

# Prepare return value for all alternate chains
if self.module.params['retrieve_all_alternates']:
self.all_chains = []

@@ -1090,6 +1095,7 @@ def _append_all_chains(cert_data):
for alt_chain in alternate_chains:
_append_all_chains(alt_chain)

# Try to select alternate chain depending on criteria
if self.module.params['select_alternate_chain']:
matching_chain = None
for criterium_idx, criterium in enumerate(self.module.params['select_alternate_chain']):

0 comments on commit 64196c9

Please sign in to comment.
You can’t perform that action at this time.