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

HTTPS traffic not captured using FiddlerCore on Linux

1 Answer 326 Views
Linux
This is a migrated thread and some comments may be shown as answers.
Cosmin
Top achievements
Rank 1
Cosmin asked on 05 Feb 2018, 12:02 PM
01.
public class ProxyConfig
02.        {
03.            private const string SecureEndpointHostname = "localhost";
04.            private readonly int _secureEndpointPort = 18888;
05. 
06.            private static readonly ICollection<Session> AllSessions = new List<Session>();
07. 
08.            private static Fiddler.Proxy _secureEndpoint;
09. 
10.            private static readonly LoggerCnx Logger = new LoggerCnx();
11. 
12.            public void SetupProxyListener()
13.            {
14.                // This is a workaround for known issue in .NET Core - https://github.com/dotnet/coreclr/issues/12668
15.                CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-US");
16. 
17.                FiddlerApplication.BeforeRequest += session =>
18.                {
19.                    // In order to enable response tampering, buffering mode MUST
20.                    // be enabled; this allows FiddlerCore to permit modification of
21.                    // the response in the BeforeResponse handler rather than streaming
22.                    // the response to the client as the response comes in.
23.                    session.bBufferResponse = false;
24.                    lock (AllSessions)
25.                    {
26.                        AllSessions.Add(session);
27.                    }
28.                };
29. 
30.                Logger.Info($"Starting {FiddlerApplication.GetVersionString()}...");
31.                CONFIG.IgnoreServerCertErrors = true;
32.                CONFIG.bCaptureCONNECT = true;
33. 
34.                FiddlerApplication.Prefs.SetBoolPref("fiddler.network.streaming.abortifclientaborts", true);
35. 
36.                FiddlerCoreStartupFlags startupFlags = FiddlerCoreStartupFlags.Default;
37.                startupFlags = (startupFlags | FiddlerCoreStartupFlags.DecryptSSL);
38. 
39.                FiddlerApplication.Startup(BaseConfiguration.ProxyPort, startupFlags);
40. 
41.                Logger.Info("Created endpoint listening on port {0}", BaseConfiguration.ProxyPort);
42. 
43.                Logger.Info("Starting with settings: [{0}]", startupFlags);
44.                Logger.Info("Gateway: {0}", CONFIG.UpstreamGateway.ToString());
45. 
46.                // Create a HTTPS listener, useful for when FiddlerCore is masquerading as a HTTPS server
47.                // instead of acting as a normal CERN-style proxy server.
48.                _secureEndpoint = FiddlerApplication.CreateProxyEndpoint(_secureEndpointPort, true, SecureEndpointHostname);
49.                if (null != _secureEndpoint)
50.                {
51.                    Logger.Info("Created secure endpoint listening on port {0}, using a HTTPS certificate for '{1}'", _secureEndpointPort, SecureEndpointHostname);
52.                }
53.            }
54.}

 

Trying to capture all traffic from browser using FiddlerCore using the .NetStandard libraries. Above is what I have.

 

Everything seems to work fine on Windows, all traffic is captured, HTTP and HTTPS.
The problem arises when I'm trying to do the same when running the code on Linux (tried it on both VM and Linux conainer, Ubuntu 16.04).
Any idea what I'm I'm missing?

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 19 Feb 2018, 12:34 PM
Hi,

Have you set the proxy settings of the machine? This should be done manually on OSs different than Windows.

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
Tags
Linux
Asked by
Cosmin
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or