1
votes

I saw many Tunnel to host:443 in Fiddler traffic interception, when I click it I saw below info: The selected session is a HTTP CONNECT Tunnel. This tunnel enables a client to send raw traffic (e.g. HTTPS-encrypted streams or WebSocket messages) through a HTTP Proxy Server (like Fiddler). I also searched this - Fiddler2: Decrypt HTTPS traffic and Tunnel to host:443

But these didn't answer my question, why do we need the HTTP CONNECT Tunnel? Why does a client need to send raw traffic?

1

1 Answers

3
votes

See https://textslashplain.com/2015/11/19/understanding-connect-tunnels/

tl;dr: Browsers need to send CONNECT tunnel requests to proxies in order for the proxy to know to what server the traffic should be sent.

The encryption provided by HTTPS prevents the proxy server from seeing the URLs or HOST headers of the requests, and these are how a proxy normally decides where to send the requests. So, for HTTPS traffic, a different approach is needed-- that approach is that the client tells the proxy: "Hey, give me a tunnel to example.com and let me know when it's ready." The proxy does so and tells the client HTTP/200 Connection established. At that point, the proxy becomes a blind byte-shuffler that takes bytes from the client and sends them to the server and returns the bytes the server replied with back to the client.