Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
-
e471a74e
by Philipp Hörist at 2018-05-01T12:14:23+02:00
3 changed files:
Changes:
| ... | ... | @@ -93,8 +93,10 @@ class NonBlockingBOSH(NonBlockingTransport): |
| 93 | 93 |
|
| 94 | 94 |
# ssl variables
|
| 95 | 95 |
self.ssl_certificate = None
|
| 96 |
+ # first ssl error
|
|
| 96 | 97 |
self.ssl_errnum = 0
|
| 97 |
- |
|
| 98 |
+ # all ssl errors
|
|
| 99 |
+ self.ssl_errors = []
|
|
| 98 | 100 |
|
| 99 | 101 |
def connect(self, conn_5tuple, on_connect, on_connect_failure):
|
| 100 | 102 |
NonBlockingTransport.connect(self, conn_5tuple, on_connect, on_connect_failure)
|
| ... | ... | @@ -508,7 +508,13 @@ class NonBlockingTLS(PlugIn): |
| 508 | 508 |
def _ssl_verify_callback(self, sslconn, cert, errnum, depth, ok):
|
| 509 | 509 |
# Exceptions can't propagate up through this callback, so print them here.
|
| 510 | 510 |
try:
|
| 511 |
+ if errnum:
|
|
| 512 |
+ self._owner.ssl_errors.append(errnum)
|
|
| 513 |
+ # This stores all ssl errors that are encountered while
|
|
| 514 |
+ # the chain is verifyed
|
|
| 511 | 515 |
if not self._owner.ssl_errnum:
|
| 516 |
+ # This records the first ssl error that is encountered
|
|
| 517 |
+ # we keep this because of backwards compatibility
|
|
| 512 | 518 |
self._owner.ssl_errnum = errnum
|
| 513 | 519 |
if depth == 0:
|
| 514 | 520 |
self._owner.ssl_certificate = cert
|
| ... | ... | @@ -339,7 +339,10 @@ class NonBlockingTCP(NonBlockingTransport, IdleObject): |
| 339 | 339 |
|
| 340 | 340 |
# ssl variables
|
| 341 | 341 |
self.ssl_certificate = None
|
| 342 |
+ # first ssl error
|
|
| 342 | 343 |
self.ssl_errnum = 0
|
| 344 |
+ # all ssl errors
|
|
| 345 |
+ self.ssl_errors = []
|
|
| 343 | 346 |
|
| 344 | 347 |
self.alpn = alpn
|
| 345 | 348 |
|