Bug 55595 - AndroidClientHandler does not validates devices using domain name
Summary: AndroidClientHandler does not validates devices using domain name
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Android+BCL Integration ()
Version: unspecified
Hardware: PC Windows
: Normal enhancement
Target Milestone: ---
Assignee: Marek Habersack
URL:
Depends on:
Blocks:
 
Reported: 2017-04-25 21:35 UTC by Sid Dubey
Modified: 2017-06-29 10:20 UTC (History)
2 users (show)

Tags: bb
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 Sid Dubey 2017-04-25 21:35:01 UTC
It is a case where device may not have valid SSL certificate. But device want to validate using domain name. 

In SetupSSL
(HttpsURLConnection httpsConnection)
socket factory is set using following line. But we couldnt find any api which will allow third party developers to set custom socketfactory
 
https://github.com/xamarin/xamarin-android/blob/master/src/Mono.Android/Xamarin.Android.Net/AndroidClientHandler.cs
 
if (tmf == null) {
// If there are no certs and no trust manager factory, we can't use a custom manager
// because it will cause all the HTTPS requests to fail because of unverified trust
// chain
if (!gotCerts)
return;
 
tmf = TrustManagerFactory.GetInstance (TrustManagerFactory.DefaultAlgorithm);
tmf.Init (keyStore);
}
 
SSLContext context = SSLContext.GetInstance ("TLS");
context.Init (kmf?.GetKeyManagers (), tmf.GetTrustManagers (), null);
httpsConnection.SSLSocketFactory = context.SocketFactory;
 
 
Customer feel this might fix the issue.
Comment 1 Marek Habersack 2017-06-29 10:20:59 UTC
This issue was addressed in https://github.com/xamarin/xamarin-android/commit/8354bef4d6c1978aa979d3b2a055a4c16a2bdfe8