Bug 22515 - Upgrading from to broke network connectivity for users behind some proxies
Summary: Upgrading from to broke network connectivity for users behin...
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 7.2.6
Hardware: PC Windows
: Normal normal
Target Milestone: Untriaged
Assignee: Martin Baulig
Depends on:
Reported: 2014-08-29 13:45 UTC by randyficker
Modified: 2016-11-11 09:53 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

HTML response generated by the proxy (1.05 KB, text/plain)
2014-08-29 13:45 UTC, randyficker

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description randyficker 2014-08-29 13:45:15 UTC
Created attachment 7874 [details]
HTML response generated by the proxy


I recently upgraded my app from Xamarion.iOS to, and several users wrote to me and complained that the app could no longer communicate with its server.

After investigating, I found all of these users were behind a proxy of some sort.  One user said he was behind a WAN optimization device called CloudBridge, and he verified that if he bypassed the proxy the app started working again.  Just so this is clear, the app fails 100% of the time with the proxy in place, and succeeds 100% of the time with no proxy.

He also verified that the app worked under through the proxy, so it really seems like something in Xamarion.iOS changed that the proxy doesn't like.

The app simply does a call to WebClient.DownloadDataAsync() -- there isn't anything special about it.  It just uploads a byte array via POST and downloads the resulting byte array.

The HTTP request never reaches the remote server, since the user's local proxy rejects it.  The exception returned to the app is:

System.Net.WebException: The remote server returned an error: (417) Expectation failed.
  at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000] in <filename unknown>:0
  at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000] in <filename unknown>:0

Reading the response stream from the WebException reveals the text the proxy is sending down, which is attached.

Obviously, I can't provide a repro project since I don't have a proxy that's causing this error, and I assume you won't either.  Can you tell me everything that's changed in the networking stack that could explain this error?  Looking at the binaries, I see some changes related to proxies between these versions of Xamarin.iOS, so I suspect one of these changes caused this problem.
Comment 1 Sebastien Pouliot 2014-08-29 13:52:36 UTC
There has been a lof of HTTP related fixes in recent 7.2.x releases. 

@Martin does this ring any bell ?
Comment 2 Martin Baulig 2014-09-01 14:23:53 UTC
Well, first we need to figure out whether it's the proxy generating this error or the remote server.

If the request really does not reach the remote server, then either there's a bug in the new networking stack.  Does this happen with all proxy servers or just with some of them?

If you don't have access to these proxy servers, would it be possible to somehow get a networking trace of the data that's sent to that proxy?  It would be very helpful to see the actual HTTP request that's being sent.
Comment 3 randyficker 2014-09-01 14:29:29 UTC
Hi Martin,

As I mentioned in the initial bug report, the error is being generated by the proxy server, and the HTTP request never reaches the remote server.

Unfortunately I don't have a proxy server that causes this issue myself, so I'm not able to run a networking trace.  Is there any code that I can put into my app that would capture what you need?
Comment 4 Martin Baulig 2014-09-01 14:34:06 UTC
Well, since this previously worked for you, we should figure out what changed.

Could you try getting a network trace with a different proxy server - just any proxy server, even if it does not trigger the problem - with both the old and the new version?  We could then look at the difference and figure out whether anything changed that may cause their proxy server to not like the request anymore.
Comment 5 randyficker 2014-11-05 14:03:55 UTC
Unfortunately I don't have any proxies available or experience running network traces.  If you want to walk me through it I can help, but it's probably something you could just as easily do yourself.

Since Xamarin.iOS is closed source, I have no way of knowing what http changes were made, so I can't even begin to debug the issue from my end.  Can these changes just be rolled back, or expose a flag where we can disable them? Or is there any other work-around we can use?
Comment 6 Martin Baulig 2016-11-11 09:53:13 UTC
Closing ancient bugs, please reopen if you're still having this problem.