rest-driver/rest-driver — pull request #149 by martinrleon (2013-08-22 22:19:17+00:00)
Title: Added methods to set a customized ClientConnectionManager and HttpParams

Enables specialized HttpClient configuration parameter and connection manager. Example code:

public static void setupHttpClient(int sslPort)
throws NoSuchAlgorithmException, KeyManagementException {
final SSLContext ctx = SSLContext.getInstance("TLS");
final X509TrustManager tm = new X509TrustManager() {

public void checkClientTrusted(X509Certificate[] xcs, String string)
throws CertificateException {
}

public void checkServerTrusted(X509Certificate[] xcs, String string)
throws CertificateException {
}

public X509Certificate[] getAcceptedIssuers() {
return null;
}
};
ctx.init(null, new TrustManager[] { tm }, null);

final SSLSocketFactory ssf = new SSLSocketFactory(ctx,
new AllowAllHostnameVerifier());

final ClientConnectionManager ccm = new BasicClientConnectionManager();
final SchemeRegistry sr = ccm.getSchemeRegistry();
sr.register(new Scheme("https", sslPort, ssf));

RestServerDriver.setClientConnectionManager(ccm);
}