Skip to content

Commit 137197b

Browse files
committed
Prevent empty warnings in case of certificate verification failures
Fixes scrapy#1976
1 parent 6aa85ae commit 137197b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scrapy/core/downloader/tls.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ def _identityVerifyingInfoCallback(self, connection, where, ret):
4444
try:
4545
verifyHostname(connection, self._hostnameASCII)
4646
except VerificationError as e:
47-
logger.warning(e)
47+
logger.warning(
48+
'Remote certificate is not valid for hostname "{}"; {}'.format(
49+
self._hostnameASCII, e))
4850

4951
except ImportError:
5052
# ImportError should not matter for older Twisted versions

0 commit comments

Comments
 (0)