File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -69,28 +69,24 @@ def check_cert_key(certpath, keypath):
6969 OpenSSL .crypto .FILETYPE_PEM , cert
7070 )
7171 crypto_public_key = certificate .get_pubkey ()
72- public_key_bytes = OpenSSL .crypto .dump_publickey (
72+ certificate_public_key = OpenSSL .crypto .dump_publickey (
7373 OpenSSL .crypto .FILETYPE_PEM , crypto_public_key
7474 )
7575
76- certificate_public_key = public_key_bytes .decode ("utf-8" )
77-
78- except Exception as error :
79- log .error (error )
76+ except OpenSSL .crypto .Error as error :
77+ log .exception (error )
8078 return False
8179
8280 try :
8381 private_key = OpenSSL .crypto .load_privatekey (
8482 OpenSSL .crypto .FILETYPE_PEM , key
8583 )
86- public_key_bytes = OpenSSL .crypto .dump_publickey (
84+ private_public_key = OpenSSL .crypto .dump_publickey (
8785 OpenSSL .crypto .FILETYPE_PEM , private_key
8886 )
8987
90- private_public_key = public_key_bytes .decode ("utf-8" )
91-
92- except Exception as error :
93- log .error (error )
88+ except OpenSSL .crypto .Error as error :
89+ log .exception (error )
9490 return False
9591
9692 return certificate_public_key .strip () == private_public_key .strip ()
You can’t perform that action at this time.
0 commit comments