Skip to content

Commit d6760db

Browse files
committed
Set SNI properly when using CONNECT
1 parent ba6dbad commit d6760db

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scrapy/core/downloader/handlers/http11.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ def processProxyResponse(self, bytes):
122122
"""
123123
self._protocol.dataReceived = self._protocolDataReceived
124124
if TunnelingTCP4ClientEndpoint._responseMatcher.match(bytes):
125-
self._protocol.transport.startTLS(self._contextFactory,
125+
# this set proper Server Name Indication extension
126+
sslOptions = self._contextFactory.creatorForNetloc(
127+
self._tunneledHost, self._tunneledPort)
128+
self._protocol.transport.startTLS(sslOptions,
126129
self._protocolFactory)
127130
self._tunnelReadyDeferred.callback(self._protocol)
128131
else:

0 commit comments

Comments
 (0)