only log cert errors if not handled by user
This commit is contained in:
parent
a26a8bd79c
commit
88b5e60807
1 changed files with 2 additions and 2 deletions
|
@ -537,8 +537,8 @@ class XMLStream(object):
|
||||||
try:
|
try:
|
||||||
cert.verify(self._expected_server_name, self._der_cert)
|
cert.verify(self._expected_server_name, self._der_cert)
|
||||||
except cert.CertificateError as err:
|
except cert.CertificateError as err:
|
||||||
log.error(err.message)
|
|
||||||
if not self.event_handled('ssl_invalid_cert'):
|
if not self.event_handled('ssl_invalid_cert'):
|
||||||
|
log.error(err.message)
|
||||||
self.disconnect(send_close=False)
|
self.disconnect(send_close=False)
|
||||||
else:
|
else:
|
||||||
self.event('ssl_invalid_cert',
|
self.event('ssl_invalid_cert',
|
||||||
|
@ -828,8 +828,8 @@ class XMLStream(object):
|
||||||
try:
|
try:
|
||||||
cert.verify(self._expected_server_name, self._der_cert)
|
cert.verify(self._expected_server_name, self._der_cert)
|
||||||
except cert.CertificateError as err:
|
except cert.CertificateError as err:
|
||||||
log.error(err.message)
|
|
||||||
if not self.event_handled('ssl_invalid_cert'):
|
if not self.event_handled('ssl_invalid_cert'):
|
||||||
|
log.error(err.message)
|
||||||
self.disconnect(self.auto_reconnect, send_close=False)
|
self.disconnect(self.auto_reconnect, send_close=False)
|
||||||
else:
|
else:
|
||||||
self.event('ssl_invalid_cert', pem_cert, direct=True)
|
self.event('ssl_invalid_cert', pem_cert, direct=True)
|
||||||
|
|
Loading…
Reference in a new issue