Skip to content

Commit

Permalink
ext. CA: correctly write the cert chain
Browse files Browse the repository at this point in the history
The cert file would have been rewritten all over again with
any of the cert in the CA cert chain without this patch.

https://pagure.io/freeipa/issue/6872
  • Loading branch information
stlaz committed Apr 18, 2017
1 parent ed3c00e commit 3cb951e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ipaserver/install/cainstance.py
Expand Up @@ -786,9 +786,10 @@ def __export_ca_chain(self):
certlist = x509.pkcs7_to_pems(data, x509.DER)

# We have all the certificates in certlist, write them to a PEM file
for cert in certlist:
with open(paths.IPA_CA_CRT, 'w') as ipaca_pem:
with open(paths.IPA_CA_CRT, 'w') as ipaca_pem:
for cert in certlist:
ipaca_pem.write(cert)
ipaca_pem.write('\n')

def __request_ra_certificate(self):
# create a temp file storing the pwd
Expand Down

0 comments on commit 3cb951e

Please sign in to comment.