this(sslcontext, null, null, BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
}
public SSLIOSession upgrade(final HttpHost host, final IOSession iosession) throws IOException {
Asserts.check(!(iosession instanceof SSLIOSession), "I/O session is already upgraded to TLS/SSL");
final SSLIOSession ssliosession = new SSLIOSession(
iosession,
SSLMode.CLIENT,
this.sslContext,
new SSLSetupHandler() {
public void initalize(
final SSLEngine sslengine) throws SSLException {
if (supportedProtocols != null) {
sslengine.setEnabledProtocols(supportedProtocols);
}
if (supportedCipherSuites != null) {
sslengine.setEnabledCipherSuites(supportedCipherSuites);
}
initializeEngine(sslengine);
}
public void verify(
final IOSession iosession,
final SSLSession sslsession) throws SSLException {
verifySession(host, iosession, sslsession);
}
});
iosession.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
ssliosession.initialize();
return ssliosession;
}