SSLSocketFactory getSSLSocketFactory()
throws GeneralSecurityException
{
if (sslSocketFactory == null)
{
TrustManager tm = new EmptyX509TrustManager();
SSLContext context = SSLContext.getInstance("SSL");
TrustManager[] trust = new TrustManager[] { tm };
context.init(null, trust, null);
sslSocketFactory = context.getSocketFactory();
}