This is a migrated thread and some comments may be shown as answers.

Fiddler as reverse proxy with HTTPS?

5 Answers 2224 Views
Windows
This is a migrated thread and some comments may be shown as answers.
Gerhard
Top achievements
Rank 1
Gerhard asked on 23 Oct 2017, 07:06 AM

Hi!

I'm new to Fiddler, I had some success, but there is also an unsolved problem. My setup is:
- An appliance with an integrated webserver. (This appliance is accessible via HTTP only)
- A PC with Fiddler (used as a reverse proxy)
- Another PC with a Browser
All 3 components are in the same network.

I want to use Fiddler for 2 tasks:
- First task is to edit the webpage of the appliance on the fly, I need to remove some content. This works fine, I managed to edit the page with FiddlerScrip. On the PC with the browser I can see the changed webpage.
- Second task: For later use there is a requirement, that this changed webpage is accessible via HTTPS. I tried a lot of settings in Fiddler, but without success. I can't even see any reaction in Fiddlers Session window when I try to access the changed webpage via HTTPS. I assume that the ports are correct, because it works with HTML. Is there a way to solve this problem?

regards
Gerhard

5 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 26 Oct 2017, 09:52 AM
Hi,

Sure, there is a way to achieve this.

First you have to create additional listener on new port. You can achieve with the QuickExec command "!listen", more information how to use it here. Then you have to reroute request coming to that new port using FiddlerScript. Fill the placeholders in the following code snippet and add it to your OnBeforeRequest method. Please, keep in mind that it is written in C# but if you are using JScript.NET you should convert it manually.

if (oSession.HostnameIs("<hostname>") && oSession.oRequest.pipeClient.LocalPort == <httpsPort>)
{
    oSession.oRequest.headers.UriScheme = "http";
    oSession.host = "<hostname>:<httpPort>";
}

Then navigating to "https://<hostname>:<httpsPort>" should show you the page from your HTTP server, but with HTTPS encryption.

As a side note I want to mention that in order this to work properly, all machines that want to access your server through HTTPS should trust Fiddler's root certificate as Certificate Authority. Otherwise the browsers will show warnings that the certificate is invalid.

Regards,
Alexander
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Dennis
Top achievements
Rank 1
answered on 05 Nov 2020, 02:22 PM

Hi Alexander

When I try your suggestion I see ERR_CONNECTION_RESET in the browser.

In Fiddler I see this error:

fiddler.network.https> HTTPS handshake to localhost (for #15) failed. System.IO.IOException The handshake failed due to an unexpected packet format.

Looks like it's still trying to use https to connect to localhost?

 

0
Nick Iliev
Telerik team
answered on 06 Nov 2020, 07:16 AM

Hey Dennis,

 

Could you try the solution suggested here and let me know if that is resolving your issue?

 

Regards,
Nick Iliev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Dennis
Top achievements
Rank 1
answered on 06 Nov 2020, 03:04 PM

Hi Nick,

The link you posted is giving me 404...

0
Nick Iliev
Telerik team
answered on 06 Nov 2020, 04:08 PM

Hey Alexander,

 

I am sorry for the inconvenience I might have caused! Here is the proper link to the thread where a similar issue has been discussed:

https://www.telerik.com/forums/io-exception-unexpected-packet-format#R6bC6XeyyECEbCDhdvUeNQ

 

Regards,
Nick Iliev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Windows
Asked by
Gerhard
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Dennis
Top achievements
Rank 1
Nick Iliev
Telerik team
Share this question
or