if (_usingSecureSocket) {
throw new IllegalStateException("Already using a secure socket");
}
SecureProtocolSocketFactory socketFactory = (SecureProtocolSocketFactory)
_protocol.getSocketFactory();
_socket = socketFactory.createSocket(_socket, _host, _port, true);
_input = _socket.getInputStream();
_output = _socket.getOutputStream();
_usingSecureSocket = true;
_tunnelEstablished = true;
log.debug("Secure tunnel created");