I know this has been asked before but I haven't managed to find a really clear answer yet -
I'm trying to implement an API within an Android app. In order to make the initial connection, I need to talk to an HTTPS URL, identifying myself with a personal X509 certificate and key.
Doing this in "desktop" Java is easy as I just reference the files.
Has anyone tried this on Android? How do you get the certificate onto the device? How did you get the code to read that and make the connection.
I have looked at the X509 certificate classes, and the SSLSocketFactory, but I am very very new to even Java and do not fully understand it - can someone help me please - a pointer or a code snippet would be very welcome.
Many thanks
Don
Asked
Active
Viewed 2,430 times
2

Don Henderson
- 61
- 4
-
I'm not sure whether there is some difference in Android but in principle you need the certificate in your JAVA_HOME. This is facilitated if you use [InstallCert](http://is.gd/tQkV0H) (was) provided by Sun. – Pantelis Sopasakis Feb 21 '11 at 12:26
1 Answers
0
Take a look here Trusting all certificates using HttpClient over HTTPS there is also source code. But be aware that there is bug in HttpsURLConnection in android's sdk - http://code.google.com/p/android/issues/detail?id=8625.

Community
- 1
- 1

Mojo Risin
- 8,136
- 5
- 45
- 58
-
1No, the OP wants to perform SSL client authentication. – President James K. Polk Feb 21 '11 at 12:17