I was a newbie to FiddlerCore.I want to capture https traffic when requested to website using Selenium and FiddlerCore in .net.Coded as below
CODE:
CONFIG.bCaptureCONNECT = true;
CONFIG.IgnoreServerCertErrors = true;
var cert = InstallCertificate();// getting true
FiddlerCoreStartupFlags flags = FiddlerCoreStartupFlags.DecryptSSL & FiddlerCoreStartupFlags.AllowRemoteClients & FiddlerCoreStartupFlags.CaptureFTP & FiddlerCoreStartupFlags.ChainToUpstreamGateway & FiddlerCoreStartupFlags.MonitorAllConnections & FiddlerCoreStartupFlags.CaptureLocalhostTraffic;
FiddlerApplication.Startup(desiredPort, flags);
FiddlerApplication.BeforeRequest += RequestDetails;
private static void RequestDetails(Session oSession)
{
Console.WriteLine("Request URL {0}", oSession.fullUrl);// getting only http traffic details
}
public static bool InstallCertificate()
{
if (!CertMaker.rootCertExists())
{
if (!CertMaker.createRootCert())
return false;
if (!CertMaker.trustRootCert())
return false;
}
return true;
}
Could you suggest me the way to capture https traffic
Thank you
Regards,
Avinash
7 Answers, 1 is accepted
Decryption requires that makecert.exe or the certificate provider be located in the appropriate folder.
It also requires that the client trust the root certificate.
Regards,
Eric Lawrence
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Getting following Exception at OnLogString Event:
FiddlerApplication.Log.OnLogString+= delegate(object sender, LogEventArgs e)
{
Console.WriteLine("Log {0}", e.LogString);
//getting following text
Process-determination failed. fiddler.config.path.lsof=/usr/sbin/lsof
Call returned 2.
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at Fiddler.Winsock.GetPIDFromLSOF(Int32 iPort)
};
Thank you,
Avinash
You didn't say what platform you're using, but the error message here suggests that you're using FiddlerCore on Mono on either Mac or Linux. The error message means exactly as it says-- it can't find the lsof executable because the value of the fiddler.config.path.lsof preference is set incorrectly.
The most likely explanation is that you could fix this by:
FiddlerApplication.Prefs.SetStringPref("fiddler.config.path.lsof", "/usr/bin/lsof");
But if that doesn't work, you'll need to find where lsof is on your system.
Only the Mono builds of Fiddler use lsof because IPHelper.dll does not exist on Mac or Linux, and hence the code described in this blog post does not run on those platforms.

http://www.telerik.com/fiddler/fiddlercore
Regards,
Eric Lawrence
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Hi Eric,
your the best problem solver please help me.
I am usinfg fiddler to capture https traffic . I used the following code please look at this
Fiddler.FiddlerApplication.Startup(iSecureEndpointPort,
FiddlerCoreStartupFlags.Default |
FiddlerCoreStartupFlags.AllowRemoteClients |
FiddlerCoreStartupFlags.DecryptSSL |
FiddlerCoreStartupFlags.MonitorAllConnections |
FiddlerCoreStartupFlags.RegisterAsSystemProxy |
FiddlerCoreStartupFlags.ChainToUpstreamGateway |
FiddlerCoreStartupFlags.CaptureLocalhostTraffic);
Fiddler.FiddlerApplication.OnNotification += delegate (object snder, NotificationEventArgs oNEA) { MessageBox.Show("** NotifyUser: " + oNEA.NotifyString); };
Fiddler.FiddlerApplication.Log.OnLogString += delegate (object snder, LogEventArgs oLEA) { MessageBox.Show("** LogString: " + oLEA.LogString); };
Fiddler.FiddlerApplication.BeforeRequest += FiddlerApplication_BeforeRequest;
//FiddlerApplication.AfterSessionComplete += new SessionStateHandler(FiddlerApplication_AfterSessionComplete);
Fiddler.FiddlerApplication.AfterSessionComplete += FiddlerApplication_AfterSessionComplete;
void FiddlerApplication_BeforeRequest(Fiddler.Session oSession)
{
try
{
oSession.bBufferResponse = false;
oSession["X-AutoAuth"] = "(default)";
}
}
public static bool InstallCertificate()
{
try
{
if (!CertMaker.rootCertExists()) // check root cert existing or not
{
if (!CertMaker.createRootCert()) //Generate root cert
{
return false;
}
if (!CertMaker.trustRootCert())
{
return false;
}
}
return true;
}
when I am running the browser from code then it's capturing session for http but not for https .
its telling "your connection is not private" . please help me.
Rick Strahl has a great blog post about using FiddlerCore to capture HTTP/S traffic. He has explained all the steps in detail and I recommend it.
Regards,
Simeon
Progress Telerik