RegistryBuilder<SchemeIOSessionStrategy> regBuilder
= RegistryBuilder.<SchemeIOSessionStrategy>create()
.register("http", NoopIOSessionStrategy.INSTANCE);
// check tlsClientParameters from message header
TLSClientParameters tlsClientParameters = outMessage.get(TLSClientParameters.class);
if (tlsClientParameters == null) {
tlsClientParameters = getTlsClientParameters();
}
if (tlsClientParameters == null) {
tlsClientParameters = new TLSClientParameters();
}
final SSLContext sslcontext = getSSLContext(tlsClientParameters);
regBuilder
.register("https",
new SSLIOSessionStrategy(sslcontext) {
@Override
protected void initializeEngine(SSLEngine engine) {
initializeSSLEngine(sslcontext, engine);
}
@Override
protected void verifySession(final HttpHost host,
final IOSession iosession,
final SSLSession sslsession) throws SSLException {
iosession.setAttribute("cxf.handshake.done", Boolean.TRUE);
setSSLSession(sslsession);
}
});
ctx.setAttribute("http.iosession-factory-registry", regBuilder.build());
} catch (GeneralSecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if (sslURL != null && !sslURL.equals(url)) {
sslURL = null;
sslState = null;
session = null;
}
if (tlsClientParameters != null && tlsClientParameters.hashCode() == lastTlsHash) {
ctx.setUserToken(sslState);
}
connectionFuture = new BasicFuture<Boolean>(callback);
HttpAsyncClient c = getHttpAsyncClient();