Hello,
could anybody please help me with this.
I am new to restlet so maybe this is a stupid question but I am stucked on this
a long time.
I need to consume OData via HTTPS in my Android app. First I followed the
ACCESSING ODATA FROM ANDROID USING RESTLET manual. I used public service and
consumed data via HTTP. Everything was ok. When I have changed the URL of my
service with HTTPS - I got "Not trusted server certificate".
I found some resources on web that helped me to add self signed cert to
TrustStore.
Then I tried this:
DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.getConnectionManager().getSchemeRegistry().register(new
Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
httpclient.getConnectionManager().getSchemeRegistry().register(new
Scheme("https", mySSLSocketFactory(), 443));
This httpClient (org.apache.http.impl.client.DefaultHttpClient) successfully
connects to the URL with this code.
httpclient.hc.execute(new HttpGet(myURL);
Now I am facing the problem how register this apache client to my restlet
service from tutorial.
I added jar files of apache httpclient extension and set it to be used by.
Engine.getInstance().getRegisteredClients().clear();
Engine.getInstance().getRegisteredClients().add(new HttpClientHelper());
But I dont know how to connect my httpclient with the helper. I tried configure
method but I was unlucky.
PLEASE, could you write me the way I can achieve that
or show some example. Any help much appriciated. Thanks.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2906937