[issue26238] httplib use wrong hostname in https request with SNI support

2016-02-02 Thread Martin Panter
Martin Panter added the comment: I still cannot reproduce any problem. When using set_tunnel(), this is the request sent to the proxy: b'CONNECT 128.6.42.21:8088 HTTP/1.0\r\n' b'\r\n' This is the SNI and request sent through the proxy to the end server: >>> wrapped =

[issue26238] httplib use wrong hostname in https request with SNI support

2016-02-02 Thread lirenke
Changes by lirenke : -- resolution: -> fixed ___ Python tracker ___ ___ Python-bugs-list

[issue26238] httplib use wrong hostname in https request with SNI support

2016-02-01 Thread lirenke
lirenke added the comment: In RFC6066, literal IPv4 is not allowed as hostname indeed. Actually, many requests still use the format of "IP+PORT" to access the server, and it seems Python don't prohibit this action explicitly. The explorer Chrome also use literal IP address to access for

[issue26238] httplib use wrong hostname in https request with SNI support

2016-02-01 Thread lirenke
lirenke added the comment: We use Python 2.7.9, and I have checked the httplib.py in 2.7.11 version same time. Notice that in set_tunnel(), self._tunnel_host have already updated by calling _get_hostport(), just like you said. It's different between 2.7.9 and 2.7.11. Then, I replace the file

[issue26238] httplib use wrong hostname in https request with SNI support

2016-01-31 Thread Martin Panter
Martin Panter added the comment: The code fragment you posted looks like it is from HTTPSConnection.connect() . But _get_hostport() is already called to set self.host in __init__(), and to set self._tunnel_host in set_tunnel().

[issue26238] httplib use wrong hostname in https request with SNI support

2016-01-29 Thread lirenke
New submission from lirenke: httplib give openssl SNI extension message like IP:PORT string. the apache server would return 400 code if SNI/request ServerName mismatch. In class HTTPSConnection, we hope call self._get_hostport() before give the value to server_hostname. === if