urllib3 does not allow to use HTTPS proxy

Created on 11 Aug 2019  路  3Comments  路  Source: urllib3/urllib3

Hi,
When I try to use HTTPS proxy, than urllib3 tries to create HTTPS tunnel by calling CONNECT. But my HTTPS proxy does not support it and resets connection after receiving it.

If I block running self._prepare_proxy(conn) function than all works fine, but I am not sure, that my fix does not broke somthing.
changes

Most helpful comment

Ah your proxy is doing forwarding not tunneling. I'm not sure about whether we support proxies that do forwarding and the reasons. Might require some investigation into what httplib supports for proxies.

All 3 comments

The standard way to connect to an HTTPS URL over an HTTP proxy is via CONNECT. Do you know why your proxy isn't following this standard? What does your proxy support?

I did not say that I connect to HTTPS :) I try to connect through HTTPS proxy.

Really, it is not mine proxy, it is common proxy that has address: https://proxy-ssl.antizapret.prostovpn.org:3143. In headers there is info that it is squid 4.2.

I had read that HTTPS proxy and HTTP tunnel (CONNECT method) is different things, and as I understand urllib3 tries to use tunnel and there is no way to switch it to proxy.

Also I tried curl and I did not see CONNECT method in traffic:
curl -x 'https://proxy-ssl.antizapret.prostovpn.org:3143' http://www.linkedin.com -v

Ah your proxy is doing forwarding not tunneling. I'm not sure about whether we support proxies that do forwarding and the reasons. Might require some investigation into what httplib supports for proxies.

Was this page helpful?
0 / 5 - 0 ratings