Bug 51182 - System.Net.Http.HttpClientHandler returns an empty body when using SSL in some circumstances
Summary: System.Net.Http.HttpClientHandler returns an empty body when using SSL in som...
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 7.0 (C8)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Marek Habersack
URL:
Depends on:
Blocks:
 
Reported: 2017-01-03 09:48 UTC by Jamie Lord
Modified: 2017-01-03 15:42 UTC (History)
2 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 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:
Status:
RESOLVED FIXED

Description Jamie Lord 2017-01-03 09:48:37 UTC
Using the default System.Net.Http.HttpClientHandleron Android to connect via SSL can result in no body being returned even though the connection has been successfully established. This may also relate to which TLS versions the server supports, in our case it uses 1.0 and 1.2 but not 1.1.

This issue only occurs on Android with iOS and Windows working correctly with the same code.

This issue can be fixed by using Xamarin.Android.Net.AndroidClientHandler() instead with everything else being identical.
Comment 1 Jamie Lord 2017-01-03 10:26:17 UTC
Possibly related to/was found with https://bugzilla.xamarin.com/show_bug.cgi?id=50587
Comment 2 Marek Habersack 2017-01-03 15:42:41 UTC
System.Net.Http.HttpClientHandler doesn't support TLS 1.2 in the current releases of XA. You need to either use AndroidClientHandler as you mention or wait for XA release that supports TLS 1.2 (should be out soon)