From 2931f4809ec2e4db0fb7b9a4bc34b70b5ef9915e Mon Sep 17 00:00:00 2001 From: Ruben van Staveren Date: Wed, 27 Jul 2022 11:21:04 +0200 Subject: [PATCH] Be a bit more descriptive in debug output for subject/issuer in the x509 material offered to us --- sort_certificate.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sort_certificate.py b/sort_certificate.py index 03305ac..413f39d 100755 --- a/sort_certificate.py +++ b/sort_certificate.py @@ -197,8 +197,11 @@ def find_intermediate_root(x509_objects, root_issuers): logging.debug('Known root issuers\n\t%s', '\n\t'.join(root_issuers)) logging.debug('Excluding issuers because of potential intermediates\n\t%s', '\n\t'.join(excluded_issuers)) - logging.debug('issuers seen in data\n\t%s', - '\n\t'.join([str(x.get_issuer()) for x in x509_objects])) + logging.debug('Certificates seen in data\n\t%s', + '\n\t'.join([f'Subject: {x.get_subject()},' + f' Issuer: {x.get_issuer()}' + for x in x509_objects])) + return [x for x in x509_objects if str(x.get_issuer()) in root_issuers and str(x.get_issuer()) not in excluded_issuers]