PATCH on Android with SSL gives 'Scheme https not registered'

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PATCH on Android with SSL gives 'Scheme https not registered'

Ralph van Etten
Hi,

I have an Android application which uses the PATCH method.
When using the standard connector I get:

Communication Error (1001) - The connector failed to complete the
communication with the server
....
Caused by: java.net.ProtocolException: Unknown method 'PATCH'; must be
one of [OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE] at
java.net.HttpURLConnection.setRequestMethod(HttpURLConnection.java:685)


So I use org.restlet.ext.httpclient and register it in my Android
application:

Engine.getInstance().getRegisteredClients().clear();
Engine.getInstance().getRegisteredClients().add(new HttpClientHelper(null));


but now I get the following exception:

Internal Connector Error (1002) - The connector encountered an
unexpected condition which prevented it from fulfilling the request
             at
org.restlet.resource.ClientResource.doError(ClientResource.java:599)
...
      Caused by: java.lang.IllegalStateException: Scheme 'https' not
registered.
             at
org.apache.http.conn.scheme.SchemeRegistry.getScheme(SchemeRegistry.java:80)
             at
org.apache.http.impl.conn.ProxySelectorRoutePlanner.determineRoute(ProxySelectorRoutePlanner.java:157)
             at
org.apache.http.impl.client.DefaultRequestDirector.determineRoute(DefaultRequestDirector.java:596)
             at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:293)
             at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
...


What does it mean and how can I fix it?

It works fine if I use an http URL. It also works fine using the
httpclient on JSE.

Thanks,

Ralph.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3090165
Reply | Threaded
Open this post in threaded view
|

Re: PATCH on Android with SSL gives 'Scheme https not registered'

Ralph van Etten
Hi again,

After trying various different Google searches I found this old message:

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

which states HTTPS support on Android is deliberately disabled. Checking
the code on GitHub this still seems to be the case:

https://github.com/restlet/restlet-framework-java/blob/master/modules/org.restlet.ext.httpclient/src/org/restlet/ext/httpclient/HttpClientHelper.java#L278

Why is HTTPS disabled on Android?

Regards,

Ralph.

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