mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-14 22:49:23 +01:00
Socket: fix crash on Python versions that do no support certificate validation.
This commit is contained in:
parent
880addf256
commit
78cf550674
@ -374,7 +374,9 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
||||
verify=verifyCertificates,
|
||||
trusted_fingerprints=network_config.ssl.serverFingerprints(),
|
||||
)
|
||||
except ssl.CertificateError as e:
|
||||
except getattr(ssl, 'CertificateError', None) as e:
|
||||
# Default to None for old Python version, which do not have
|
||||
# CertificateError
|
||||
drivers.log.critical(('Certificate validation failed when '
|
||||
'connecting to %s: %s\n'
|
||||
'This means someone is doing a man-in-the-middle attack '
|
||||
|
Loading…
Reference in New Issue
Block a user