mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-06 13:23:14 +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
|
||||
versions into account
|
||||
"""
|
||||
if isinstance(cert, str) or isinstance(cert, unicode):
|
||||
if isinstance(cert, (str, unicode, bytes)):
|
||||
encoded = base64.b64encode(cert)
|
||||
else:
|
||||
encoded = base64.b64encode(cert.public_bytes(Encoding.DER))
|
||||
|
||||
Reference in New Issue
Block a user