Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTPS->HTTP via Fiddler

Tags:

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

like image 462
Yohay Etsion Avatar asked Apr 06 '12 07:04

Yohay Etsion


People also ask

How do I send HTTP request using Fiddler?

Sending GET Request To create a GET request inside Fiddler, choose the GET method and type the server URL in the URL box. Then click the Execute button. NOTE: Once the request is sent to the server, use the Inspectors to inspect the response.

How do I enable HTTPS request in Fiddler?

In Fiddler, go to Tools > Fiddler Options > HTTPS. Select Capture HTTPS CONNECTs and Decrypt HTTPS traffic. Go to File > Capture Traffic or press F12 to turn off capturing.

How do I enable decrypt HTTPS traffic in Fiddler?

Enable HTTPS traffic decryptionClick Tools > Options > HTTPS. Click the Decrypt HTTPS Traffic box.


2 Answers

@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;
    }   
like image 134
Softlion Avatar answered Sep 21 '22 03:09

Softlion


Try this:

if (oSession.fullUrl.StartsWith("http://"))
{
  oSession.oRequest.headers.UriScheme = "https";
}
like image 25
Troy Hunt Avatar answered Sep 18 '22 03:09

Troy Hunt