mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 08:00:02 -06:00
cert_find: fix call with --all
When ipa cert-find --all is called, the function prints the certificate public bytes. The code recently switched to OpenSSL.crypto and the objects OpenSSL.crypto.X509 do not have the method public_bytes(). Use to_cryptography() to transform into a cryptography.x509.Certificate before calling public_bytes(). Related: https://pagure.io/freeipa/issue/9331 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
parent
fd0fd487df
commit
1f30cc6527
@ -1827,6 +1827,7 @@ class cert_find(Search, CertMethod):
|
||||
# For the case of CA-less we need to keep
|
||||
# the certificate because getting it again later
|
||||
# would require unnecessary LDAP searches.
|
||||
cert = cert.to_cryptography()
|
||||
obj['certificate'] = (
|
||||
base64.b64encode(
|
||||
cert.public_bytes(x509.Encoding.DER))
|
||||
|
Loading…
Reference in New Issue
Block a user