if (sslMode != SSLMode.Disable && sslMode != SSLMode.Allow) {
// Execute SSL request command
SSLRequestCommand sslRequestCommand = protocol.createSSLRequest();
if (sslRequestCommand == null && sslMode.isRequired()) {
throw new IOException("SSL not available");
}
protocol.execute(sslRequestCommand);
// Did server allow it?
if (sslRequestCommand.isAllowed()) {
// Attach the actual handler
SSLEngine sslEngine = SSLEngineFactory.create(sslMode, context);