Add logging in ssltools

This commit is contained in:
Klaus-Uwe Mitterer 2017-06-21 21:38:36 +02:00
parent c88f4f2007
commit af06c5af6f
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import datetime, OpenSSL, socket, ssl
import datetime, logging, OpenSSL, socket, ssl
PEM = 0
DER = 1
@ -27,4 +27,4 @@ def getRemoteExpiry(host,port):
try:
return datetime.datetime.strptime(str(OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, getRemoteCert(host, port)).get_notAfter().decode("UTF-8")), "%Y%m%d%H%M%SZ")
except:
pass
logging.exception("Could not receive remote certificate")