SocketFactory socketfactory = sslContext.getSocketFactory();
int connectTimeout = params.getConnectionTimeout();
if (connectTimeout == 0) {
return socketfactory.createSocket(host, port, localAddress, localPort);
} else {
Socket socket = socketfactory.createSocket();
SocketAddress localSocketAddress = new InetSocketAddress(localAddress, localPort);
SocketAddress remoteSocketAddress = new InetSocketAddress(host, port);
socket.bind(localSocketAddress);