mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-11-02 20:30:26 -06:00
cert: include certificate chain in cert command output
Include the full certificate chain in the output of cert-request, cert-show and cert-find if --chain or --all is specified. If output file is specified in the CLI together with --chain, the full certificate chain is written to the file. https://pagure.io/freeipa/issue/6547 Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
1 parent
c60d9c9744
commit
8ed891cb61
4 files changed
+56
-12
No files matched your search
@@ -57,7 +57,10 @@ class CertRetrieveOverride(MethodOverride):
|
||||
result = super(CertRetrieveOverride, self).forward(*args, **options)
|
||||
|
||||
if certificate_out is not None:
|
||||
certs = [result['result']['certificate']]
|
||||
if options.get('chain', False):
|
||||
certs = result['result']['certificate_chain']
|
||||
else:
|
||||
certs = [result['result']['certificate']]
|
||||
certs = (x509.normalize_certificate(cert) for cert in certs)
|
||||
certs = (x509.make_pem(base64.b64encode(cert)) for cert in certs)
|
||||
with open(certificate_out, 'w') as f:
|
||||
|
||||
Reference in new issue
Block a user