[issue24599] urllib URLopener().open https url returns 501 Not Implemented when https_proxy env var is http://
Martin Panter
report at bugs.python.org
Fri Jul 10 02:00:37 CEST 2015
Martin Panter added the comment:
David: the original patch made in Issue 1424152 fixed Python 2’s urllib.request.urlopen() and Python 2’s urllib2.urlopen(). But Stefano is using URLopener, which I understand comes from Python 2’s older “urllib” module.
When I run the demonstration, the request to the proxy looks like this:
GET https://www.python.org HTTP/1.1
Host: www.python.org
Accept-Encoding: identity
Connection: close
User-Agent: Python-urllib/3.4
I think Stefano requires a “CONNECT www.python.org:443” request instead. There is apparently a patch which sounds like it does this. See issue1424152-py27-urllib.diff and the messages beginning with <https://bugs.python.org/issue1424152#msg194704>. I suggest any further work (e.g. tests and documentation) continue here, since the other issue has been closed and mainly discusses “urllib2”.
----------
nosy: +vadmium
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24599>
_______________________________________
More information about the Python-bugs-list
mailing list