if (tracker.isLayered()) {
throw new IllegalStateException("Multiple protocol layering not supported");
}
HttpHost target = tracker.getTargetHost();
Scheme scheme = this.manager.getSchemeRegistry().getScheme(target);
LayeringStrategy layeringStrategy = scheme.getLayeringStrategy();
if (layeringStrategy == null) {
throw new IllegalStateException(scheme.getName() +
" scheme does not provider support for protocol layering");
}
IOSession iosession = this.entry.getIOSession();
SSLIOSession ssliosession = (SSLIOSession) layeringStrategy.layer(iosession);
ssliosession.bind(SSLMode.CLIENT, params);
conn.upgrade(ssliosession);
tracker.layerProtocol(layeringStrategy.isSecure());
}