summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2017-01-13 18:54:34 +0100
committerMartin Basti <mbasti@redhat.com>2017-01-31 18:33:27 +0100
commitd5ab0637fe89cbcb61491fe08b7376aeaf7ccdb8 (patch)
tree4d0bb72e574173bc809bf4f5ac3e62491e7d7167 /ipaserver
parent1023cfebff99af165212dee94290a05754297270 (diff)
downloadfreeipa-d5ab0637fe89cbcb61491fe08b7376aeaf7ccdb8.tar.gz
freeipa-d5ab0637fe89cbcb61491fe08b7376aeaf7ccdb8.tar.xz
freeipa-d5ab0637fe89cbcb61491fe08b7376aeaf7ccdb8.zip
py3: fix CSR encoding inside framework
csr must be in string because framework excpects only strings, so we have to decode it back https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Christian Heimes <cheimes@redhat.com>
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/plugins/cert.py4
-rw-r--r--ipaserver/plugins/dogtag.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/ipaserver/plugins/cert.py b/ipaserver/plugins/cert.py
index c5ed9bf18..5bf4cfba3 100644
--- a/ipaserver/plugins/cert.py
+++ b/ipaserver/plugins/cert.py
@@ -804,7 +804,9 @@ class cert_request(Create, BaseCertMethod, VirtualCommand):
try:
# re-serialise to PEM, in case the user-supplied data has
# extraneous material that will cause Dogtag to freak out
- csr_pem = csr_obj.public_bytes(serialization.Encoding.PEM)
+ # keep it as string not bytes, it is required later
+ csr_pem = csr_obj.public_bytes(
+ serialization.Encoding.PEM).decode('utf-8')
result = self.Backend.ra.request_certificate(
csr_pem, profile_id, ca_id, request_type=request_type)
except errors.HTTPRequestError as e:
diff --git a/ipaserver/plugins/dogtag.py b/ipaserver/plugins/dogtag.py
index dc33d2f6d..2f9fd4b37 100644
--- a/ipaserver/plugins/dogtag.py
+++ b/ipaserver/plugins/dogtag.py
@@ -1634,7 +1634,7 @@ class ra(rabase.rabase, RestClient):
self.debug('%s.request_certificate()', type(self).__name__)
# Call CMS
- template = '''<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+ template = u'''<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<CertEnrollmentRequest>
<ProfileID>{profile}</ProfileID>
<Input id="i1">