Merge pull request #1220 from GLolol/drivers/logging

Socket: lower SSL related log level, and reword text to flow better
This commit is contained in:
Valentin Lorentz 2016-02-24 19:31:13 +01:00
commit bf02f79847

View File

@ -280,7 +280,7 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
if network_config.ssl(): if network_config.ssl():
self.starttls() self.starttls()
elif not network_config.requireStarttls(): elif not network_config.requireStarttls():
drivers.log.critical(('Connection to network %s' drivers.log.warning(('Connection to network %s '
'does not use SSL/TLS, which makes it vulnerable to ' 'does not use SSL/TLS, which makes it vulnerable to '
'man-in-the-middle attacks and passive eavesdropping. ' 'man-in-the-middle attacks and passive eavesdropping. '
'You should consider upgrading your connection to SSL/TLS ' 'You should consider upgrading your connection to SSL/TLS '
@ -378,19 +378,19 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
except getattr(ssl, 'CertificateError', None) as e: except getattr(ssl, 'CertificateError', None) as e:
# Default to None for old Python version, which do not have # Default to None for old Python version, which do not have
# CertificateError # CertificateError
drivers.log.critical(('Certificate validation failed when ' drivers.log.error(('Certificate validation failed when '
'connecting to %s: %s\n' 'connecting to %s: %s\n'
'This means someone is doing a man-in-the-middle attack ' 'This means either someone is doing a man-in-the-middle '
'on your connection, or the server\'s certificate is ' 'attack on your connection, or the server\'s certificate is '
'not in your trusted fingerprints list.') 'not in your trusted fingerprints list.')
% (self.irc.network, e.args[0])) % (self.irc.network, e.args[0]))
raise ssl.SSLError('Aborting because of failed certificate ' raise ssl.SSLError('Aborting because of failed certificate '
'verification.') 'verification.')
except ssl.SSLError as e: except ssl.SSLError as e:
drivers.log.critical(('Certificate validation failed when ' drivers.log.error(('Certificate validation failed when '
'connecting to %s: %s\n' 'connecting to %s: %s\n'
'This means someone is doing a man-in-the-middle attack ' 'This means either someone is doing a man-in-the-middle '
'on your connection, or that the server\'s ' 'attack on your connection, or the server\'s '
'certificate is not trusted.') 'certificate is not trusted.')
% (self.irc.network, e.args[1])) % (self.irc.network, e.args[1]))
raise ssl.SSLError('Aborting because of failed certificate ' raise ssl.SSLError('Aborting because of failed certificate '