Yohay Etsion
Yohay Etsion

Reputation: 211

HTTPS->HTTP via Fiddler

I'm looking for a way to use Fiddler to proxy an HTTPS session into an HTTP session, so the explorer will use an HTTP session while the Fiddler handles the HTTPS session in front of the server:

Client (explorer) <--http--> Fiddler <--https--> Server

Can anyone say if this can be done via Fiddler scripting?

If you have another idea how to do this with another tool (not Fiddler), I'm open to suggestions :)

Thanks! Yohay

Upvotes: 21

Views: 9960

Answers (2)

Softlion
Softlion

Reputation: 12615

@troy's answer is nice but not enough. You should handle CONNECT's:

    if (oSession.HostnameIs("app.yourdomain.com") ) 
     {  
        // Handle CONNECT Tunnels
        if (oSession.HTTPMethodIs("CONNECT"))
        {
            oSession["x-replywithtunnel"] = "FakeTunnel";
            return;
        }           

        oSession.fullUrl = "http://somedomain:someport" + oSession.PathAndQuery;
    }   

Upvotes: 19

Troy Hunt
Troy Hunt

Reputation: 20407

Try this:

if (oSession.fullUrl.StartsWith("http://"))
{
  oSession.oRequest.headers.UriScheme = "https";
}

Upvotes: 10

Related Questions