I am using ModernHttpClient for calling webservices to enable TLS 1.2 support. And this is working fine in device versions below 5.0.
To fix the issue in 4.0 devices i forked the library and set the socket factory settings as suggested in many forms,
if (((int)Build.VERSION.SdkInt) < 21)
{
var socketFactory = new ImprovedSSLSocketFactory();
client.SetSocketFactory(socketFactory);
//client.Init(null, new ITrustManager[] { new CustomX509TrustManager(trustManagers[0].JavaCast<IX509TrustManager>()) }, null);
}
But still the issue is there. Now i am getting the error.
Javax.Net.SSl.SSLHandshakeException :
java.security.cert.CertPathValidationException:
Trust anchor for certification path not found
Please help