Search code examples
xamarinxamarin.androidhttpclientandroidhttpclient

Xamarin Native Android HttpClient, where is it located?


When i select the native implementation for the HttpClient in Visual Studio like:

selection of HttpClient

And i use the HttpClient in my code.

  • where does the HttpClient code live ?
  • Is it in a native Android library ?
  • Or is it in the Google Play Services ?
  • Where could I find out ?

Solution

  • HttpClient implementation:

    where does the HttpClient code live ?

    HttpClient is the "normal" System.Net.Http.HttpClient, but when using the AndroidClientHander there is a custom System.Net.Http.HttpClientHandler that uses Java.Net.HttpURLConnection as its implementation:

    Re: xamarin-android/src/Mono.Android/Xamarin.Android.Net/AndroidClientHandler.cs

    SSL/TLS implementation:

    Is it in a native Android library ?

    As far as the "native" TLS 1.2+ option, it is provided by a bundled version of Google's Boring SSL (boringssl) which is included in your apk (it is a native NDK/C shared library)