I searched any possible solution to trust all certificate using Resteasy client, but I could not find a single working solution. I'm beginning to think that there is no way to do this using Resteasy 2.2.1.
Now, this is a sample of what I've done so far for a normal HTTP connection using resteasy client setting a proxy:
org.apache.commons.httpclient.HttpClient hc = new HttpClient();
ApacheHttpClientExecutor ace;
String proxyhost = getProperty("proxyHost");
Integer proxyport = getProperty("proxyPort", Integer.class);
boolean useProxy = (proxyhost != null);
if(useProxy){
hc.getHostConfiguration().setProxy(proxyhost, proxyport);
ace = new ApacheHttpClientExecutor(hc);
} else {
ace = new ApacheHttpClientExecutor();
}
ClientRequestFactory crf = new ClientRequestFactory(ace,uri);
Now, how can I tell to my ClientRequestFactory
or my ApacheHttpClientExecutor
or my HttpClient
to trust all certificate?
Beware: I'm using Resteasy 2.2.1 (JBoss 5.1) I can't migrate to JBoss 7 or use a different resteasy version so I can't accept any answer that uses ResteasyClientBuilder
I can already see the good guy that answer "You shouldn't trust all certificate, it's evil!". This is an HTTP client used for Integration test, so it's pointless to consider (at this test level) the SSL certificate. I will absolutely not do this in production.