You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is in this part from scrapy.core.downloader.handlers.http11TunnelingTCP4ClientEndpoint. creatorForNetloc raises an exception which is not handled by twisted.
defprocessProxyResponse(self, rcvd_bytes):
"""Processes the response from the proxy. If the tunnel is successfully created, notifies the client that we are ready to send requests. If not raises a TunnelError. """self._connectBuffer+=rcvd_bytes# make sure that enough (all) bytes are consumed# and that we've got all HTTP headers (ending with a blank line)# from the proxy so that we don't send those bytes to the TLS layer## see https://github.com/scrapy/scrapy/issues/2491ifb'\r\n\r\n'notinself._connectBuffer:
returnself._protocol.dataReceived=self._protocolDataReceivedrespm=TunnelingTCP4ClientEndpoint._responseMatcher.match(self._connectBuffer)
ifrespmandint(respm.group('status')) ==200:
# set proper Server Name Indication extensionsslOptions=self._contextFactory.creatorForNetloc(self._tunneledHost, self._tunneledPort)
self._protocol.transport.startTLS(sslOptions, self._protocolFactory)
self._tunnelReadyDeferred.callback(self._protocol)
Description
Downloader gets stuck when trying to download a url having not valid domain. It works good, but without proxy.
Steps to Reproduce
Expected behavior: a request leaves downloader
Actual behavior: a request do not leave downloader and it gets stuck
Reproduces how often: 100%
Versions
Scrapy : 2.5.0
lxml : 4.6.3.0
libxml2 : 2.9.10
cssselect : 1.1.0
parsel : 1.6.0
w3lib : 1.22.0
Twisted : 21.2.0
Python : 3.8.9 (default, Apr 10 2021, 15:55:09) - [GCC 8.3.0]
pyOpenSSL : 20.0.1 (OpenSSL 1.1.1k 25 Mar 2021)
cryptography : 3.4.7
Platform : Linux-5.10.15-200.fc33.x86_64-x86_64-with-glibc2.2.5
Additional context
The problem is in this part from
scrapy.core.downloader.handlers.http11TunnelingTCP4ClientEndpoint
.creatorForNetloc
raises an exception which is not handled by twisted.Traceback
The text was updated successfully, but these errors were encountered: