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, i开发者_JAVA百科dentifying 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 DonTake 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.
精彩评论