Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fiddler not capturing traffic from .Net Core

I have a console app that calls a number of 3rd party services via HTTP/HTTPS that was originally written to run under the .Net Framework. Fiddler works fine with that version of the app, capturing all of the HTTP and HTTPS traffic.

I ported the app to .net Core 2.1 and now Fiddler does not capture any of the HTTP/HTTPS traffic from the app.

Any suggestions as to why Fiddler (v5.0) is not working to capture traffic from the .Net Core app?

like image 876
Mike Moore Avatar asked Jul 07 '18 06:07

Mike Moore


People also ask

How do I enable capturing 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.

Does Fiddler only capture browser traffic?

Fiddler Everywhere allows you to capture, inspect, monitor and replay both HTTP and HTTPS network traffic from any browser and any app.


1 Answers

In my office environment, Fiddler still does not intercept requests that are issued by .NET Core 2.2 against external resources. I guess this is due to our local proxy setup.

My workaround is to capture requests from .NET Core 2.2 by explicitly defining Fiddler as a proxy to be used by the HttpClient class:

        var httpClient = new HttpClient(
           handler: new HttpClientHandler
           {
               // 8888 = Fiddler standard port
               Proxy = new WebProxy(new Uri("http://localhost:8888")),  
               UseProxy = true
           }
        );

This reliably tunnels all requests coming from Core through Fiddler.

like image 122
Jpsy Avatar answered Sep 20 '22 21:09

Jpsy