@@ -0,0 +1,2473 @@
+package com.testclient.utils;%0A%0Aimport java.io.IOException;%0Aimport java.net.InetAddress;%0Aimport java.net.Socket;%0Aimport java.net.UnknownHostException;%0A%0Aimport javax.net.ssl.SSLContext;%0Aimport javax.net.ssl.TrustManager;%0A%0Aimport org.apache.commons.httpclient.ConnectTimeoutException;%0Aimport org.apache.commons.httpclient.HttpClientError;%0Aimport org.apache.commons.httpclient.params.HttpConnectionParams;%0Aimport org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory;%0Aimport org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory;%0A%0Apublic class TheSecureProtocolSocketFactory implements SecureProtocolSocketFactory %7B%0A%09private SSLContext sslContext = null;%0A%09%0A%09public TheSecureProtocolSocketFactory() %7B%0A%09%7D%0A%09%0A%09private static SSLContext createEasySSLContext() %7B%0A%09   try %7B%0A%09    SSLContext context = SSLContext.getInstance(%22SSL%22);%0A%09    context.init(null, new TrustManager%5B%5D %7B new TheX509TrustManager() %7D,%0A%09      null);%0A%09    return context;%0A%09   %7D catch (Exception e) %7B%0A%09    throw new HttpClientError(e.toString());%0A%09   %7D%0A%09%7D%0A%09%0A%09private SSLContext getSSLContext() %7B%0A%09   if (this.sslContext == null) %7B%0A%09    this.sslContext = createEasySSLContext();%0A%09   %7D%0A%09   return this.sslContext;%0A%09%7D%0A%09%0A%09public Socket createSocket(String host, int port, InetAddress clientHost,%0A%09    int clientPort) throws IOException, UnknownHostException %7B%0A%09   return getSSLContext().getSocketFactory().createSocket(host, port,%0A%09     clientHost, clientPort);%0A%09%7D%0A%09%0A%09public Socket createSocket(final String host, final int port,%0A%09    final InetAddress localAddress, final int localPort,%0A%09    final HttpConnectionParams params) throws IOException,%0A%09    UnknownHostException, ConnectTimeoutException %7B%0A%09   if (params == null) %7B%0A%09    throw new IllegalArgumentException(%22Parameters may not be null%22);%0A%09   %7D%0A%09   int timeout = params.getConnectionTimeout();%0A%09   if (timeout == 0) %7B%0A%09    return createSocket(host, port, localAddress, localPort);%0A%09   %7D else %7B   %0A%09    return ControllerThreadSocketFactory.createSocket(this, host, port,%0A%09      localAddress, localPort, timeout);%0A%09   %7D%0A%09%7D%0A%09%0A%09public Socket createSocket(String host, int port) throws IOException,%0A%09    UnknownHostException %7B%0A%09   return getSSLContext().getSocketFactory().createSocket(host, port);%0A%09%7D%0A%09%0A%09public Socket createSocket(Socket socket, String host, int port,%0A%09    boolean autoClose) throws IOException, UnknownHostException %7B%0A%09   return getSSLContext().getSocketFactory().createSocket(socket, host,%0A%09     port, autoClose);%0A%09%7D%0A%7D%0A

Create TheSecureProtocolSocketFactory.java