开发者

Using personal X509 certificate to connect to SSL protected API in Android app?

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

Don


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜