mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -06:00
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>
This commit is contained in:
parent
1023cfebff
commit
d5ab0637fe
@ -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:
|
||||
|
@ -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">
|
||||
|
Loading…
Reference in New Issue
Block a user