Skip to content

Commit 2f54f96

Browse files
committed
Ignore HTTPS certificate verification failures
Fixes scrapy#1930
1 parent 6e47427 commit 2f54f96

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scrapy/core/downloader/contextfactory.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from OpenSSL import SSL
22
from twisted.internet.ssl import ClientContextFactory
33

4+
45
try:
56

67
from zope.interface.declarations import implementer
@@ -11,6 +12,12 @@
1112
from twisted.web.client import BrowserLikePolicyForHTTPS
1213
from twisted.web.iweb import IPolicyForHTTPS
1314

15+
16+
class ScrapyClientTLSOptions(ClientTLSOptions):
17+
def _identityVerifyingInfoCallback(self, connection, where, ret):
18+
pass
19+
20+
1421
@implementer(IPolicyForHTTPS)
1522
class ScrapyClientContextFactory(BrowserLikePolicyForHTTPS):
1623
"""
@@ -49,7 +56,7 @@ def getContext(self, hostname=None, port=None):
4956
return self.getCertificateOptions().getContext()
5057

5158
def creatorForNetloc(self, hostname, port):
52-
return ClientTLSOptions(hostname.decode("ascii"), self.getContext())
59+
return ScrapyClientTLSOptions(hostname.decode("ascii"), self.getContext())
5360

5461

5562
@implementer(IPolicyForHTTPS)

0 commit comments

Comments
 (0)