views:

280

answers:

2

I'm connecting to a REST service using HttpClient under Android. I'd like to be able to write code where I could pull the host, port, etc. out of a properties file and not have to write fake Schemes and other things like that in order to do the development work. In other words, the live site will have a cert. The dev site will have a self-signed cert or a CA cert. Either way, I need the code to seamlessly work with both kinds of certs if possible. Can someone point me in the right direction?

+1  A: 

there is a very good writing about SSL here http://crazybob.org/2010/02/android-trusting-ssl-certificates.html

Alex Volovoy
Thanks, I'll take a look at it as soon as I can. Getting to SSL soon. Was put on the backburner temporarily.
Preston Crawford
A: 

Bob's solution works if you control the cert on the server. But what if you dont? how can I use SSL with the DefaultHttpClient for a cert from ANY CA?

Ben