5

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.

Rowland Shaw
  • 37,700
  • 14
  • 97
  • 166
Sergey Aldoukhov
  • 22,316
  • 18
  • 72
  • 99
  • I haven't tried any HTTPS coding with WP7, but could it be a certificate issue? http://msdn.microsoft.com/en-us/library/gg521150%28v=VS.92%29.aspx – keyboardP Jun 09 '11 at 00:52
  • Could be - but there is no ServicePointManager in WP7 to skip cert errors... – Sergey Aldoukhov Jun 09 '11 at 01:27
  • errr... which argument is null in this case? And how exactly are you hitting this on an IPAD? – EricLaw Jun 09 '11 at 03:20
  • I can't tell what argument is null - the response carries the exception, and one of the properties (which is of string type) on exception is this stack. – Sergey Aldoukhov Jun 09 '11 at 04:20
  • On IPad, we have the same application, written in obj-c. On IPad, we have assigned a proxy to a Fiddler proxy and while browser traffic including HTTPS has no problems, the app does not receive a response when it tries to access auth url. Maybe it is tied to a particular backend - gotta try another HTTPS... – Sergey Aldoukhov Jun 09 '11 at 04:31
  • If you've enabled HTTPS Decryption on the iOS device, you need a different certificate generator (http://www.fiddler2.com/fiddler/help/httpsdecryption.asp#ios) but this isn't required for WP7. – EricLaw Jun 17 '11 at 03:45

1 Answers1

11

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.

Jonas Stawski
  • 6,682
  • 6
  • 61
  • 106