Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging HTTPS traffic with Fiddler on Windows Phone Emulator

I have followed Eric's advice and it works fine, with the exception that requests using https through HttpWebRequest fail to connect. In Fiddler, I see a Connect request which seems to return fine and then my HttpWebRequest receives a result with an ArgumentNullException.

Here's the call stack of the exception:

   at System.IO.StringReader..ctor(String s)
   at System.Net.Browser.HttpWebRequestHelper.ParseHeaders(Uri requestUri, SecurityCriticalDataForMultipleGetAndSet`1 headers, WebHeaderCollection collection, Boolean removeHttpOnlyCookies, HttpStatusCode& status, String& statusDescription)
   at System.Net.Browser.ClientHttpWebResponse..ctor(String method, Uri url, HttpStatusCode status, String mime, SecurityCriticalDataForMultipleGetAndSet`1 headersString, Stream stream, Int32 expectedLen, CookieContainer cookieContainer)
   at System.Net.Browser.ClientHttpWebResponse..ctor(String method, Uri url, HttpStatusCode status, String mime, SecurityCriticalDataForMultipleGetAndSet`1 headersString, Stream stream, CookieContainer cookieContainer)
   at System.Net.Browser.ClientHttpWebRequest.Failed(Object sender, EventArgs e)
   at MS.Internal.InternalWebRequest.OnDownloadFailed(Object sender, ErrorEventArgs args)
   at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)

Browser works fine, my guess it is some kind of problem between .Net on the phone and the Fiddler's proxy. BTW, the same thing happens on the real phone and even on IPad (which means this is not .Net specific problem)

Can it be fixed?

EDIT: I am probably against some security restriction that I don't understand. I tried https://wellsfargo.com and https://mail.google.com and both return "Not Found" exception when using Fiddler.

like image 601
Sergey Aldoukhov Avatar asked Jun 08 '11 20:06

Sergey Aldoukhov


1 Answers

You have to install Fiddler's Root Cert into the emulator. Open Mobile IE and browse to: http://computername:8888/fiddlerroot.cer. When prompted, install the cert. After you're done HTTPS traffic will tunnel through fiddler without a problem.

like image 152
Jonas Stawski Avatar answered Oct 27 '22 19:10

Jonas Stawski