Commit e471a74e by Philipp Hörist

Record all ssl errors that are encountered

parent 541d0da1
Pipeline #1414 passed with stages
in 22 seconds
......@@ -93,8 +93,10 @@ class NonBlockingBOSH(NonBlockingTransport):
# ssl variables
self.ssl_certificate = None
# first ssl error
self.ssl_errnum = 0
# all ssl errors
self.ssl_errors = []
def connect(self, conn_5tuple, on_connect, on_connect_failure):
NonBlockingTransport.connect(self, conn_5tuple, on_connect, on_connect_failure)
......
......@@ -508,7 +508,13 @@ class NonBlockingTLS(PlugIn):
def _ssl_verify_callback(self, sslconn, cert, errnum, depth, ok):
# Exceptions can't propagate up through this callback, so print them here.
try:
if errnum:
self._owner.ssl_errors.append(errnum)
# This stores all ssl errors that are encountered while
# the chain is verifyed
if not self._owner.ssl_errnum:
# This records the first ssl error that is encountered
# we keep this because of backwards compatibility
self._owner.ssl_errnum = errnum
if depth == 0:
self._owner.ssl_certificate = cert
......
......@@ -339,7 +339,10 @@ class NonBlockingTCP(NonBlockingTransport, IdleObject):
# ssl variables
self.ssl_certificate = None
# first ssl error
self.ssl_errnum = 0
# all ssl errors
self.ssl_errors = []
self.alpn = alpn
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment