Prevent empty warnings in case of certificate verification failures

Fixes #1976
This commit is contained in:
Paul Tremberth 2016-05-11 13:12:35 +02:00
parent 6aa85aee2a
commit 137197b98b
1 changed files with 3 additions and 1 deletions

View File

@ -44,7 +44,9 @@ try:
try:
verifyHostname(connection, self._hostnameASCII)
except VerificationError as e:
logger.warning(e)
logger.warning(
'Remote certificate is not valid for hostname "{}"; {}'.format(
self._hostnameASCII, e))
except ImportError:
# ImportError should not matter for older Twisted versions