Bug 41830 - HttpClient requests timing out after Cycle 7 update
Summary: HttpClient requests timing out after Cycle 7 update
Status: RESOLVED DUPLICATE of bug 41697
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Net.Http ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-06-14 22:55 UTC by Matt Corley
Modified: 2016-06-15 20:27 UTC (History)
5 users (show)

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

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 GitHub or Developer Community 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:
Status:
RESOLVED DUPLICATE of bug 41697

Description Matt Corley 2016-06-14 22:55:51 UTC
We are experiencing an issue making certain HTTP requests via HttpClient with the latest Xamarin updates.  

Running our app in iOS Simulator, we make two sequential calls to our API:  
(1) POST to login
(2) GET to retrieve a list of information, using auth token from call 1

The POST call works.  However, the second call fails after a few minutes due to a timeout, with a System.Threading.Tasks.TaskCanceledException. 

Of course, we have confirmed that both calls work using tools like cURL and Postman.  We are awaiting httpClient.SendAsync for all requests.

Downgrading back to the Cycle 6 stable release fixes the problem.  We also tried using the latest beta and alpha channels, but we had the same issue as described above.

Note: I have seen another recent bug relating to hitting IP addresses (41782).  I should point out we are accessing our API via a domain name, not directly by IP.

Version Information:

Mono Framework MDK 4.4.0.182
Xamarin Studio 6.0.0
Xamarin.iOS 9.8.0.323
Xamarin.Android 6.1.0.71
Xamarin.Mac 2.8.0.323

PCL Profile 111
System.Net.Http
Comment 1 Marek Safar 2016-06-15 08:34:35 UTC
Which http client handler are you using?
Comment 2 Jeremy Haelewyn 2016-06-15 13:13:56 UTC
Same problem. Resolved by Downgrading.
Comment 3 Matt Corley 2016-06-15 15:22:33 UTC
@Marek We are using the default handler, like so:

using (var httpClient = new HttpClient()){
...
}

We have also tried installing the ModernHttpClient NuGet package, and then using the NativeMessageHandler, but got the same result.

using (var httpClient = new HttpClient(new NativeMessageHandler())){
...
}
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2016-06-15 20:09:36 UTC
> Running our app in iOS Simulator

This might be an issue with the new Apple TLS default setting on Xamarin.iOS, rather than an issue with Mono itself.

> By default your projects will now use the new Apple TLS stack which
> uses native code (better performance) and support the newest TLS 1.1
> and 1.2 standards. This is a change from previous preview releases of
> XI 9.8.

(https://developer.xamarin.com/releases/ios/xamarin.ios_9/xamarin.ios_9.8/)




## Possible workaround

(If a user hitting this issue can confirm that the following workaround helps, then we can probably fairly safely mark this as a duplicate of Bug 41697.)

Under "Project Options > iOS Build", change the "SSL/TLS implementation" setting back to the old default "Mono (TLS v1.0)".
Comment 5 Matt Corley 2016-06-15 20:20:49 UTC
@Brendan The workaround seems to solve the issue. Thank you!

*** This bug has been marked as a duplicate of bug 41697 ***
Comment 6 Brendan Zagaeski (Xamarin Team, assistant) 2016-06-15 20:27:34 UTC
Excellent.  Thanks for the quick test!