The problem in this scenario is that you are processing this traffic twice:
Firstly, the browser sends a CONNECT to port 8888, saying: βPlease give me a TCP / IP tunnel for port 7777,β and then after Fiddler says, βOK, we will do itβ, the client sends an HTTPS request through this tunnel to port 7777.
The problem is that you are managing this CONNECT response and returning the HTML instead of skipping the HTTPS handshake from port 7777.
The easiest way to fix this is to change the BeforeRequest code to the following:
if ( (oS.hostname == sSecureEndpointHostname) && (oS.port==7777) && !oS.HTTPMethodIs("CONNECT")) {
After this, your CONNECT tunnel will no longer be crippled and the HTTPS handshake will succeed.
EricLaw
source share