Recently posted a question regarding the HttpClient
over Https (found here). I\'ve made some headway, but I\'ve run into new issues. As with my last problem, I
Here is a much simple version using 4.1.2 httpclient code. This can then be modified to any trust algorithm you see fit.
public static HttpClient getTestHttpClient() {
try {
SSLSocketFactory sf = new SSLSocketFactory(new TrustStrategy(){
@Override
public boolean isTrusted(X509Certificate[] chain,
String authType) throws CertificateException {
return true;
}
});
SchemeRegistry registry = new SchemeRegistry();
registry.register(new Scheme("https", 443, sf));
ClientConnectionManager ccm = new ThreadSafeClientConnManager(registry);
return new DefaultHttpClient(ccm);
} catch (Exception e) {
return new DefaultHttpClient();
}
}