if((getAcceptSelfSignedCertificates().booleanValue())) {
factory = new EasySSLProtocolSocketFactory();
Protocol easyhttps = new Protocol("https", factory, port);
Protocol.registerProtocol("https", easyhttps);
} else {
factory = new SSLProtocolSocketFactory();
Protocol stricthttps = new Protocol("https", factory, port);
Protocol.registerProtocol("https", stricthttps);
}
}