Hi all,

I'm new to Restlet (and WS in general), so I'm counting on your understanding 
if my questions seem stupid. :)

I've been playing around with a test web service using Restlet 2.0.14 
framework. My server uses JSE whilst my client is on Android.
I've created a self-signed certificate, which has been already added 
(configuring the various parameters) on the server side. I have checked this 
using openssl and also a web browser (as a client), and the certificate seems 
to be working fine on the server. The problem is, as you have probably guessed, 
the fact that Android doesn't trust my certificate, since it's not in the 
trusted authorities list.

I have found this workaround (http://stackoverflow.com/a/4837230) in order to 
overcome the problem, which basically creates a custom http client (based on 
the apache client) including some ssl related parameters, in order for the 
client to trust all authorities.

Now, let me not bother you any more with the generics and get to my question. 
This "workaround" creates a custom http client, so it returns an object of 
DefaultHttpClient type. But, on my client app this is how I register new client:

Engine.getInstance().getRegisteredClients().add(0, new HttpClientHelper(null)); 

This method requires an HttpHelper object, not a DefaultHttpClient object like 
the one I have prepared for the ssl connection. So, I would like to ask (hoping 
that this is not the stupidest question ever) for some guidance or example on 
how to correlate the custom http client with the http client/connector that my 
app uses by default (which is supposed to be the apache http client). Or put it 
simple, how do I "load" the custom - self-signed certificate ready - http 
client on my Android client?


Also, one more question. If I had purchased a CA-provided certificate (for 
example from Verisign), I wouldn't have to do any of these workarounds, right? 
All I had to do is define the client protocol (when creating a resource) to 
HTTPS instead of HTTP, and the rest (downloading and accepting the certificate 
from the server) would be done automatically, right?

Thanks in advance for any assistance. If you need more info about my 
implementation, I will happily provide it.

br,
Alex

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2991328

Reply via email to