mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-25 04:02:45 +01:00
IRCNetwork: handle the case when certificate fingerprint checking is on but the remote provides no cert
This commit is contained in:
parent
fefd5a1f6b
commit
b26d75a6a8
@ -1642,8 +1642,12 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils):
|
||||
raise conf.ConfigurationError('Unsupported or invalid TLS/SSL certificate fingerprint type %r',
|
||||
hashtype)
|
||||
else:
|
||||
fp = hashfunc(peercert).hexdigest()
|
||||
expected_fp = self.serverdata.get('ssl_fingerprint')
|
||||
if expected_fp and peercert is None:
|
||||
raise ssl.CertificateError('TLS/SSL certificate fingerprint checking is enabled but the uplink '
|
||||
'did not provide a certificate')
|
||||
|
||||
fp = hashfunc(peercert).hexdigest()
|
||||
|
||||
if expected_fp:
|
||||
if fp != expected_fp:
|
||||
|
Loading…
Reference in New Issue
Block a user