From 621c41dcd606ae1231d37d1eef0b3ff9b373e40a Mon Sep 17 00:00:00 2001 From: +++ Date: Sat, 21 Oct 2023 21:04:29 +0200 Subject: [PATCH] anzeige des zertifikates in eigener funktion --- source/client/python/setstatus.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/source/client/python/setstatus.py b/source/client/python/setstatus.py index e6fccfa..a8edfff 100755 --- a/source/client/python/setstatus.py +++ b/source/client/python/setstatus.py @@ -102,6 +102,15 @@ class SetStatus: return False return True + def display_cert(self, cert): + """ + param 1: cert object + """ + self.log.debug('--- Peer cert ---') + self.log.debug('Subject: {}'.format(cert['subject'])) + self.log.debug('SerialNumber: {}'.format(cert['serialNumber'])) + self.log.debug('-----------------') + def log_config(self): """ Logs the config if loglevel is debug. @@ -179,13 +188,9 @@ class SetStatus: self.log.error('Connection failed: {}'.format(e)) exit(5) self.log.debug('Conection established') - self.log.debug('Peer certificate commonName: {}'.format( - ssl_socket.getpeercert()['subject'][5][0][1])) - self.log.debug('Peer certificate serialNumber: {}'.format( - ssl_socket.getpeercert()['serialNumber'])) + self.display_cert(ssl_socket.getpeercert()) return ssl_socket - def run(self, status): """ starts the engine.