HTTPS 트래픽에 대한 내 도구의 모든 시작에 인증서 표시를 생성 제거해야합니다 :내가 피들러 내가 피들러 코어를 시도하는이 테스트 도구가
이 테스트 도구가 작동static void Main(string[] args)
{
#region AttachEventListeners
//
// It is important to understand that FiddlerCore calls event handlers on the
// session-handling thread. If you need to properly synchronize to the UI-thread
// (say, because you're adding the sessions to a list view) you must call .Invoke
// on a delegate on the window handle.
//
// Simply echo notifications to the console. Because Fiddler.CONFIG.QuietMode=true
// by default, we must handle notifying the user ourselves.
Fiddler.FiddlerApplication.OnNotification += delegate(object sender, NotificationEventArgs oNEA)
{
Console.WriteLine("** NotifyUser: " + oNEA.NotifyString);
};
Fiddler.FiddlerApplication.Log.OnLogString += delegate(object sender, LogEventArgs oLEA)
{
Console.WriteLine("** LogString: " + oLEA.LogString);
};
Fiddler.FiddlerApplication.BeforeRequest += delegate(Fiddler.Session oS)
{
Console.WriteLine("Before request for:\t" + oS.fullUrl);
// In order to enable response tampering, buffering mode must
// be enabled; this allows FiddlerCore to permit modification of
// the response in the BeforeResponse handler rather than streaming
// the response to the client as the response comes in.
oS.bBufferResponse = false;
};
Fiddler.FiddlerApplication.BeforeResponse += delegate(Fiddler.Session oS)
{
Console.WriteLine("{0}:HTTP {1} for {2}", oS.id, oS.responseCode, oS.fullUrl);
// Uncomment the following two statements to decompress/unchunk the
// HTTP response and subsequently modify any HTTP responses to replace
// instances of the word "Microsoft" with "Bayden"
//oS.utilDecodeResponse(); oS.utilReplaceInResponse("Microsoft", "Bayden");
};
Fiddler.FiddlerApplication.AfterSessionComplete += delegate(Fiddler.Session oS)
{
Console.WriteLine("Finished session:\t" + oS.fullUrl);
};
// Tell the system console to handle CTRL+C by calling our method that
// gracefully shuts down the FiddlerCore.
Console.CancelKeyPress += new ConsoleCancelEventHandler(Console_CancelKeyPress);
#endregion AttachEventListeners
Console.WriteLine("Starting FiddlerCore...");
// For the purposes of this demo, we'll forbid connections to HTTPS
// sites that use invalid certificates
Fiddler.CONFIG.IgnoreServerCertErrors = true;
Fiddler.CONFIG.bMITM_HTTPS = true;
Fiddler.CertMaker.removeFiddlerGeneratedCerts();
if (!Fiddler.CertMaker.rootCertExists())
{
if (!Fiddler.CertMaker.createRootCert())
{
throw new Exception("Unable to create cert for FiddlerCore.");
}
}
if (!Fiddler.CertMaker.rootCertIsTrusted())
{
if (!Fiddler.CertMaker.trustRootCert())
{
throw new Exception("Unable to install FiddlerCore's cert.");
}
}
// Because we've chosen to decrypt HTTPS traffic, makecert.exe must
// be present in the Application folder.
Fiddler.FiddlerApplication.Startup(8877, true, true);
Console.WriteLine("Hit CTRL+C to end session.");
// Wait Forever for the user to hit CTRL+C.
// BUG BUG: Doesn't properly handle shutdown of Windows, etc.
Object forever = new Object();
lock (forever)
{
System.Threading.Monitor.Wait(forever);
}
}
/// <summary>
/// When the user hits CTRL+C, this event fires. We use this to shut down and unregister our FiddlerCore.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
{
Console.WriteLine("Shutting down...");
Fiddler.FiddlerApplication.Shutdown();
System.Threading.Thread.Sleep(750);
}
, 나는, HTTPS 트래픽을 캡처 할 수있는 I 내 실제 도구가 필요합니다. 그러나 도구를 시작할 때마다 인증서를 다시 설치하고 다시 신뢰해야합니다. 내가
Fiddler.CertMaker.removeFiddlerGeneratedCerts();
때마다 호출하지 않는 경우,이 도구는 HTTPS 트래픽을 캡처하지 않습니다, 나는 작업 중지를 모니터링하고있어 응용 프로그램은 분명히 요청 피들러에 의해 차단하지만 응용 프로그램에 전달하지 얻을 것 때문에 .
매번 피들러 인증서를 삭제할 필요가 없도록 어떻게 설정해야합니까?
Fiddler 'CertMaker.dll'부가 기능을 사용하고 있습니까? 그렇다면 콘솔에 참조가 표시됩니다. – EricLaw
예, 있습니다. 내가 작성한 것처럼 원칙적으로 모든 것이 작동하며 처음으로 도구를 시작할 때 HTTPS 트래픽이 잘 보입니다. 그것은 도구가 시작될 때마다 피들러 인증서를 제거해야하거나 작동을 멈추는 것입니다. http://i.imgur.com/qv3sif3.png – Hackworth
FWIW, 나는 동일한 문제가 있었고 솔루션은 프로젝트에서 certmaker.dll을 제거하고 대신 makecert.exe를 앱의 출력 폴더에 저장하는 것이 었습니다. 이를 통해 FiddlerCore는 앱 출시 전반에 걸쳐 작동하는 스티커 인증서를 만들 수 있으며 인증서를 한 번만 등록 할 수 있습니다 (SSL 설치/제거 옵션을 쉽게 추가 할 수 있습니다). –