Hi, i am using Restlet client ClientResource to act as a REST Client, i will use HTTPS connection and trying to set SslContext to ClientResource, is there any way to set javax.net.ssl.SSLContext to ClientResouce?
below codes will generate exception which caused ClientResource start failed. SSLContext sslContext = null; sslContext = SSLContext.getInstance("tls"); sslContext.init(..., ..., ...); clientResource.getContext().getAttributes().put("sslContextFactory", sslContext); errors: WARNING: Unable to start the Restlet java.lang.ClassCastException: javax.net.ssl.SSLContext cannot be cast to org.restlet.ext.ssl.SslContextFactory at org.restlet.ext.ssl.internal.SslUtils.getSslContextFactory(SslUtils.java:135) at org.restlet.ext.ssl.HttpsClientHelper.start(HttpsClientHelper.java:146) at org.restlet.Client.start(Client.java:217) at org.restlet.Restlet.handle(Restlet.java:315) at org.restlet.Client.handle(Client.java:177) at org.restlet.routing.Filter.doHandle(Filter.java:159) at org.restlet.routing.Filter.handle(Filter.java:206) at org.restlet.resource.ClientResource.handle(ClientResource.java:1136) at org.restlet.resource.ClientResource.handleOutbound(ClientResource.java:1225) at org.restlet.resource.ClientResource.handle(ClientResource.java:1068) at org.restlet.resource.ClientResource.handle(ClientResource.java:1044) at org.restlet.resource.ClientResource.post(ClientResource.java:1453) thanks, Emre -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/how-to-set-javax-net-ssl-SSLContext-to-Restlet-ClientResource-tp7578897.html Sent from the Restlet Discuss mailing list archive at Nabble.com. ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3062605