private Socket startSSL(Socket sock, String host) throws IOException {
SSLSocketFactory sslFactory = getSSLSocketFactory(host);
SSLSocket secureSocket;
if (sslFactory != null) {
try {
secureSocket = (SSLSocket) sslFactory.createSocket(sock,
sock.getInetAddress().getHostName(), sock.getPort(), true);
secureSocket.setUseClientMode(false);
if (log.isDebugEnabled()){
log.debug(port + "SSL transaction ok with cipher: " + secureSocket.getSession().getCipherSuite());
}