mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-08-13 06:25:00 -05:00
x509: Make certificates represented as objects
https://pagure.io/freeipa/issue/4985 Reviewed-By: Fraser Tweedale <ftweedal@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
committed by
Pavel Vomacka
parent
4375ef860f
commit
b5732efda6
@@ -66,10 +66,9 @@ class CertRetrieveOverride(MethodOverride):
|
||||
certs = result['result']['certificate_chain']
|
||||
else:
|
||||
certs = [result['result']['certificate']]
|
||||
certs = (x509.ensure_der_format(cert) for cert in certs)
|
||||
certs = (x509.make_pem(base64.b64encode(cert)) for cert in certs)
|
||||
with open(certificate_out, 'w') as f:
|
||||
f.write('\n'.join(certs))
|
||||
certs = (x509.load_der_x509_certificate(
|
||||
x509.ensure_der_format(cert)) for cert in certs)
|
||||
x509.write_certificate_list(certs, certificate_out)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user