mirror of
https://github.com/progval/Limnoria.git
synced 2025-04-27 13:31:08 -05:00
Socket: Remove misleading error fallback for Python <3.4.
We no longer support this Python version. Fixes GH-1412.
This commit is contained in:
parent
b4df468b3a
commit
d56e8ef73d
@ -412,9 +412,7 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
|||||||
trusted_fingerprints=network_config.ssl.serverFingerprints(),
|
trusted_fingerprints=network_config.ssl.serverFingerprints(),
|
||||||
ca_file=network_config.ssl.authorityCertificate(),
|
ca_file=network_config.ssl.authorityCertificate(),
|
||||||
)
|
)
|
||||||
except getattr(ssl, 'CertificateError', None) as e:
|
except ssl.CertificateError as e:
|
||||||
# Default to None for old Python version, which do not have
|
|
||||||
# CertificateError
|
|
||||||
drivers.log.error(('Certificate validation failed when '
|
drivers.log.error(('Certificate validation failed when '
|
||||||
'connecting to %s: %s\n'
|
'connecting to %s: %s\n'
|
||||||
'This means either someone is doing a man-in-the-middle '
|
'This means either someone is doing a man-in-the-middle '
|
||||||
@ -423,15 +421,6 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
|||||||
% (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:
|
|
||||||
drivers.log.error(('Certificate validation failed when '
|
|
||||||
'connecting to %s: %s\n'
|
|
||||||
'This means either someone is doing a man-in-the-middle '
|
|
||||||
'attack on your connection, or the server\'s '
|
|
||||||
'certificate is not trusted.')
|
|
||||||
% (self.irc.network, e.args[1]))
|
|
||||||
raise ssl.SSLError('Aborting because of failed certificate '
|
|
||||||
'verification.')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user