mirror of https://github.com/scrapy/scrapy.git
Catch and ignore TLS verification exception for IP-address hosts
Fixes GH-2092
This commit is contained in:
parent
441df4c853
commit
37efdde3e3
|
|
@ -48,6 +48,11 @@ try:
|
|||
'Remote certificate is not valid for hostname "{}"; {}'.format(
|
||||
self._hostnameASCII, e))
|
||||
|
||||
except ValueError as e:
|
||||
logger.warning(
|
||||
'SSL/TLS verification failed for hostname "{}"; {}'.format(
|
||||
self._hostnameASCII, e))
|
||||
|
||||
except ImportError:
|
||||
# ImportError should not matter for older Twisted versions
|
||||
# as the above is not used in the fallback ScrapyClientContextFactory
|
||||
|
|
|
|||
|
|
@ -335,6 +335,14 @@ class Https11WrongHostnameTestCase(Http11TestCase):
|
|||
certfile = 'keys/example-com.cert.pem'
|
||||
|
||||
|
||||
class Https11InvalidDNSId(Https11TestCase):
|
||||
"""Connect to HTTPS hosts with IP while certificate uses domain names IDs."""
|
||||
|
||||
def setUp(self):
|
||||
super(Https11InvalidDNSId, self).setUp()
|
||||
self.host = '127.0.0.1'
|
||||
|
||||
|
||||
class Http11MockServerTestCase(unittest.TestCase):
|
||||
"""HTTP 1.1 test case with MockServer"""
|
||||
if twisted_version < (11, 1, 0):
|
||||
|
|
|
|||
Loading…
Reference in New Issue