@SuppressWarnings("deprecation")
  private ServerConnector createSelectChannelConnectorForClient(Server server, int acceptors) {
    Map<String, String> configsMap = configs.getConfigsMap();
    ServerConnector apiConnector;

    HttpConfiguration http_config = new HttpConfiguration();
    http_config.setRequestHeaderSize(configs.getHttpRequestHeaderSize());
    http_config.setResponseHeaderSize(configs.getHttpResponseHeaderSize());
    http_config.setSendServerVersion(false);
    if (configs.getApiSSLAuthentication()) {
      String httpsKeystore = configsMap.get(Configuration.CLIENT_API_SSL_KSTR_DIR_NAME.getKey()) +
        File.separator + configsMap.get(Configuration.CLIENT_API_SSL_KSTR_NAME.getKey());
      String httpsTruststore = configsMap.get(Configuration.CLIENT_API_SSL_KSTR_DIR_NAME.getKey()) +
        File.separator + configsMap.get(Configuration.CLIENT_API_SSL_TSTR_NAME.getKey());
      LOG.info("API SSL Authentication is turned on. Keystore - " + httpsKeystore);

      String httpsCrtPass = configsMap.get(Configuration.CLIENT_API_SSL_CRT_PASS.getKey());

      HttpConfiguration https_config = new HttpConfiguration(http_config);
      SecureRequestCustomizer src = new SecureRequestCustomizer();
      src.setSniRequired(false);
      src.setSniHostCheck(false);
      https_config.addCustomizer(src);
      https_config.setSecurePort(configs.getClientSSLApiPort());

      SslContextFactory.Server contextFactoryApi = new SslContextFactory.Server();
      disableInsecureProtocols(contextFactoryApi);
      contextFactoryApi.setKeyStorePath(httpsKeystore);
      contextFactoryApi.setTrustStorePath(httpsTruststore);
      contextFactoryApi.setKeyStorePassword(httpsCrtPass);
      contextFactoryApi.setKeyManagerPassword(httpsCrtPass);
      contextFactoryApi.setTrustStorePassword(httpsCrtPass);
      contextFactoryApi.setKeyStoreType(configsMap.get(Configuration.CLIENT_API_SSL_KSTR_TYPE.getKey()));
      contextFactoryApi.setTrustStoreType(configsMap.get(Configuration.CLIENT_API_SSL_KSTR_TYPE.getKey()));
      contextFactoryApi.setSniRequired(false);
      apiConnector = new ServerConnector(server, acceptors, -1,
        new SslConnectionFactory(contextFactoryApi, HttpVersion.HTTP_1_1.toString()),
        new HttpConnectionFactory(https_config));
      apiConnector.setPort(configs.getClientSSLApiPort());
    } else  {
      apiConnector = new ServerConnector(server, acceptors, -1, new HttpConnectionFactory(http_config));
      apiConnector.setPort(configs.getClientApiPort());
    }
    apiConnector.setIdleTimeout(configs.getConnectionMaxIdleTime());

    return apiConnector;
  }
Create org.eclipse.jetty.server.nio.SelectChannelConnector
implementation for SSL or non-SSL based on configuration.

@param port connector port
@param needClientAuth one-way / two-way SSL
@return org.eclipse.jetty.server.nio.SelectChannelConnector
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java