mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-08-05 14:24:48 +00:00
Merge pull request #195 from rjeffman/fix_encode_certificate
Properly handle certificates stored as bytes in encode_certificate.
This commit is contained in:
@@ -280,7 +280,7 @@ def encode_certificate(cert):
|
|||||||
Encode a certificate using base64 with also taking FreeIPA and Python
|
Encode a certificate using base64 with also taking FreeIPA and Python
|
||||||
versions into account
|
versions into account
|
||||||
"""
|
"""
|
||||||
if isinstance(cert, str) or isinstance(cert, unicode):
|
if isinstance(cert, (str, unicode, bytes)):
|
||||||
encoded = base64.b64encode(cert)
|
encoded = base64.b64encode(cert)
|
||||||
else:
|
else:
|
||||||
encoded = base64.b64encode(cert.public_bytes(Encoding.DER))
|
encoded = base64.b64encode(cert.public_bytes(Encoding.DER))
|
||||||
|
|||||||
Reference in New Issue
Block a user