URL: https://github.com/freeipa/freeipa/pull/936
Author: stlaz
 Title: #936: cainstance: read cert file as bytes
Action: opened

PR body:
"""
https://pagure.io/freeipa/issue/4985

------
Another small thing that slipped through my fingers, happens during external CA 
installation.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/936/head:pr936
git checkout pr936
From a5a39aa2687cf55d06813f02b21bd14e1c9b938b Mon Sep 17 00:00:00 2001
From: Stanislav Laznicka <slazn...@redhat.com>
Date: Thu, 27 Jul 2017 13:32:12 +0200
Subject: [PATCH] cainstance: read cert file as bytes

https://pagure.io/freeipa/issue/4985
---
 ipaserver/install/cainstance.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py
index d60093a2e8..2eec33a591 100644
--- a/ipaserver/install/cainstance.py
+++ b/ipaserver/install/cainstance.py
@@ -581,7 +581,7 @@ def __spawn_instance(self):
 
         elif self.external == 2:
             cert_file = tempfile.NamedTemporaryFile()
-            with open(self.cert_file) as f:
+            with open(self.cert_file, 'rb') as f:
                 ext_cert = x509.load_unknown_x509_certificate(f.read())
             cert_file.write(ext_cert.public_bytes(x509.Encoding.PEM))
             cert_file.flush()
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to