Https through an http-only proxy

httpsPROXY

My organisation directs all traffic through a proxy. As proxy settings, we are required to use an http proxy setting for both the http_proxy & https_proxy environment variables.

If I set the https_proxy variable to an https version of the same proxy, some programs the use the https_proxy env variable cease to work.

So does this mean that the proxy does not support https connections? What about https websites that load normally in my browser?

Best Answer

Beware when you set http_proxy and https_proxy, normally you should set them at the same URL including the schema part, example:

http_proxy=http://your_proxy:proxy_port
https_proxy=http://your_proxy:proxy_port

Notice that both are in HTTP. That tells you the protocol your proxy uses, not the target website's schema, which can be HTTP or HTTPS, that is not related.

When, using the proxy for connecting to a HTTPS website, the proxy works in TCP mode, and (I'm simplifying here) your TCP connection passes through the proxy carrying encrypted packets from your client to the target website.

So, try setting your https_proxy environment variable the same as your http_proxy and hope you're allowed to use the CONNECT method.

Related Topic