Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Prevent empty warnings in case of certificate verification failures

Paul Tremberth137197b98b1d
diff --git a/scrapy/core/downloader/tls.py b/scrapy/core/downloader/tls.py
index 2cf8ba869..5fa8e2723 100644
--- a/scrapy/core/downloader/tls.py
+++ b/scrapy/core/downloader/tls.py
@@ -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