return new SSLIOSession(session, sslcontext, sslHandler);
}
public void connected(final IOSession session) {
try {
SSLIOSession sslSession = createSSLIOSession(
session,
this.sslcontext,
this.sslHandler);
NHttpClientIOTarget conn = createConnection(
sslSession);
session.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
session.setAttribute(SSL_SESSION, sslSession);
Object attachment = session.getAttribute(IOSession.ATTACHMENT_KEY);
this.handler.connected(conn, attachment);
try {
sslSession.bind(SSLMode.CLIENT, this.params);
} catch (SSLException ex) {
this.handler.exception(conn, ex);
sslSession.shutdown();
}
} catch (RuntimeException ex) {
session.shutdown();
throw ex;
}