Add logging in ssltools
This commit is contained in:
parent
c88f4f2007
commit
af06c5af6f
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
import datetime, OpenSSL, socket, ssl
|
import datetime, logging, OpenSSL, socket, ssl
|
||||||
|
|
||||||
PEM = 0
|
PEM = 0
|
||||||
DER = 1
|
DER = 1
|
||||||
|
@ -27,4 +27,4 @@ def getRemoteExpiry(host,port):
|
||||||
try:
|
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")
|
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:
|
except:
|
||||||
pass
|
logging.exception("Could not receive remote certificate")
|
||||||
|
|
Loading…
Reference in a new issue