Hi guys!
I'm trying to access a HTTPS site that's using client authentication
via certificates with webview.
I've loaded my keystore containing the proper certificates and I can
see that I have all certificates i need in there.
But when calling the HTTPS site I can not access it, when sniffing
with wireshark I can see that the client (android) is sending an empty
certificate answer. In fact I can see no difference wether I try to
call my method below or not.
So I think I need to find a way to tell webview to use my
SocketFactory, seems like HttpsURLConnection.setDefaultSSLSocketFactory
() is not the right thing to use.
Any help is greatly appreciated!
My code looks like:
private void installCertStore()
{
try
{
KeyStore keyStore = KeyStore.getInstance
(KeyStore.getDefaultType());
InputStream fis = this.getResources().openRawResource
(R.raw.browsercert);
keyStore.load(fis, "password".toCharArray());
KeyManagerFactory kmf = KeyManagerFactory.getInstance
("X509");
kmf.init(keyStore, "password".toCharArray());
SSLContext sc = SSLContext.getInstance("TLS");
sc.init(kmf.getKeyManagers(), null, null);
SSLSocketFactory sfc = sc.getSocketFactory();
HttpsURLConnection.setDefaultSSLSocketFactory(sfc);
} catch (Exception e)
{
Log.e("BROWSER", "installCertStore failed", e);
e.printStackTrace();
}
}
Bye,
Thomas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---