equal
deleted
inserted
replaced
183 if has_https and self.realhostport: # use CONNECT proxy |
183 if has_https and self.realhostport: # use CONNECT proxy |
184 self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
184 self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
185 self.sock.connect((self.host, self.port)) |
185 self.sock.connect((self.host, self.port)) |
186 if _generic_proxytunnel(self): |
186 if _generic_proxytunnel(self): |
187 # we do not support client X.509 certificates |
187 # we do not support client X.509 certificates |
188 self.sock = sslutil.ssl_wrap_socket(self.sock, None, None) |
188 self.sock = sslutil.ssl_wrap_socket(self.sock, None, None, |
|
189 serverhostname=self.host) |
189 else: |
190 else: |
190 keepalive.HTTPConnection.connect(self) |
191 keepalive.HTTPConnection.connect(self) |
191 |
192 |
192 def getresponse(self): |
193 def getresponse(self): |
193 proxyres = getattr(self, 'proxyres', None) |
194 proxyres = getattr(self, 'proxyres', None) |
339 host = self.host |
340 host = self.host |
340 if self.realhostport: # use CONNECT proxy |
341 if self.realhostport: # use CONNECT proxy |
341 _generic_proxytunnel(self) |
342 _generic_proxytunnel(self) |
342 host = self.realhostport.rsplit(':', 1)[0] |
343 host = self.realhostport.rsplit(':', 1)[0] |
343 self.sock = sslutil.ssl_wrap_socket( |
344 self.sock = sslutil.ssl_wrap_socket( |
344 self.sock, self.key_file, self.cert_file, |
345 self.sock, self.key_file, self.cert_file, serverhostname=host, |
345 **sslutil.sslkwargs(self.ui, host)) |
346 **sslutil.sslkwargs(self.ui, host)) |
346 sslutil.validator(self.ui, host)(self.sock) |
347 sslutil.validator(self.ui, host)(self.sock) |
347 |
348 |
348 class httpshandler(keepalive.KeepAliveHandler, urllib2.HTTPSHandler): |
349 class httpshandler(keepalive.KeepAliveHandler, urllib2.HTTPSHandler): |
349 def __init__(self, ui): |
350 def __init__(self, ui): |