From e5f817fc95e6b33dac114c5a337ca1c371023e8c Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 15 Jun 2018 15:57:45 -0700 Subject: [PATCH] IRCNetwork: suppress "You can enhance...security...[with] ssl_fingerprint" notices when TLS cert validation is enabled --- classes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes.py b/classes.py index dff3883..9d0e73c 100644 --- a/classes.py +++ b/classes.py @@ -1628,7 +1628,7 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils): def _verify_ssl(self): """ - Implements additional SSL/TLS verification (so far, only certificate fingerprints if enabled). + Implements additional SSL/TLS verifications (so far, only certificate fingerprints when enabled). """ peercert = self._socket.getpeercert(binary_form=True) @@ -1657,7 +1657,7 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils): else: log.info('(%s) Uplink TLS/SSL certificate fingerprint ' 'verified (%s: %r)', self.name, hashtype, fp) - else: + elif hasattr(self._socket, 'context') and self._socket.context.verify_mode == ssl.CERT_NONE: log.info('(%s) Uplink\'s TLS/SSL certificate fingerprint (%s) ' 'is %r. You can enhance the security of your ' 'link by specifying this in a "ssl_fingerprint"'