final HttpHost host,
final InetSocketAddress remoteAddress,
final InetSocketAddress localAddress,
final HttpContext context) throws IOException {
LayeredConnectionSocketFactory factory = getSSLSocketFactory();
return factory.connectSocket(connectTimeout, sock, host, remoteAddress, localAddress, context);
}
private LayeredConnectionSocketFactory getSSLSocketFactory() {
final Configuration currentConfiguration = MfClientHttpRequestFactoryImpl.getCurrentConfiguration();
if (currentConfiguration == null || currentConfiguration.getCertificateStore() == null) {