Skip to content
Snippets Groups Projects
Unverified Commit 5bf93d2b authored by Thomas Woerner's avatar Thomas Woerner Committed by GitHub
Browse files

Merge pull request #195 from rjeffman/fix_encode_certificate

Properly handle certificates stored as bytes in encode_certificate.
parents 8f91c209 1a3c9114
No related branches found
No related tags found
No related merge requests found
...@@ -280,7 +280,7 @@ def encode_certificate(cert): ...@@ -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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment