Unfortunately, "HTTPS proxy" has two distinct meanings:
- A proxy that can forward HTTPS traffic to the destination. This proxy itself is using an HTTP protocol to set up the forwarding.
In case the browser is trying to connect to a website using HTTPS, the browser will send a CONNECT
request to the proxy, and the proxy will set up a TCP connection with the website and mirror all TCP traffic sent on the connection from the browser to the proxy onto the connection between the proxy and the website, and similarly mirror the response TCP packets from the webite to the connection with the browser. Hypothetically, the same mechanism using CONNECT
could be used with HTTP traffic, but practically speaking browsers don't do that. For HTTP traffic, they send the actual HTTP request to the proxy, including the full path in the HTTP command (as well as setting the Host
header: https://stackoverflow.com/a/38259076/10026
So, by this definition, HTTPS Proxy is a proxy that understands the CONNECT directive and can support HTTPS traffic going between the browser and the website.
- A proxy that uses HTTPS protocol to secure traffic forwarding.
In this mode (sometimes referred to as "Secure Proxy"), the connection between the browser and the proxy itself (used for either HTTP or HTTPS traffic) is protected by TLS. The browser uses the Proxy's own certificate to establish the secure connection with the proxy, and then sends either HTTP or HTTPS traffic, including CONNECT
requests, on that connection as per (1). So, the traffic between the browser and the proxy is always encrypted with a TLS key derived using the Proxy's certificate, regardless of whether the traffic itself is encrypted with a key negotiated between the browser and the website. If HTTPS traffic is proxied via a secure proxy, it is double-encrypted between the browser and the proxy.
For example, the Proxy Switcher Chrome plugin has two separate settings to control each of these definitions:
It gets a bit more complicated because some proxies that proxy HTTPS traffic don't simply set up a TCP relay, as described in (1), but act as Intercepting Proxies. Using a spoofed website certificate, they effectively perform a Man-in-the-Middle attack (well, it's not necessarily an attack because it's expected behavior). Whereas the browser thinks it's using the website's certificate to set up a TLS tunnel with a website, it's actually using a spoofed certificate to set up TLS tunnel with the proxy, and the proxy sets up the TLS tunnel with the website. Then proxy has visibility into the HTTPS requests/responses. But all of that is completely orthogonal to whether the proxy is acting as a secure proxy as per (2).