private SslConnectionFactory createSslConnectionFactory(KeyStoreInformation config) {
    SslContextFactory sslContextFactory = new SslContextFactory();

    sslContextFactory.setKeyStorePath(config.getKeyStorePath());
    sslContextFactory.setKeyStorePassword(String.valueOf(config.getKeyStorePassword()));
    sslContextFactory.setKeyManagerPassword(String.valueOf(config.getKeyPassword()));

    return new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString());
  }
예제 #2
0
  public ServerConnector createConnector(
      Server server, KeyStoreInformation config, String host, int port) {

    SslContextFactory sslContextFactory = new SslContextFactory();

    sslContextFactory.setKeyStorePath(config.getKeyStorePath());
    sslContextFactory.setKeyStorePassword(String.valueOf(config.getKeyStorePassword()));
    sslContextFactory.setKeyManagerPassword(String.valueOf(config.getKeyPassword()));

    ServerConnector connector =
        new ServerConnector(
            server,
            new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()),
            new HttpConnectionFactory());

    connector.setPort(port);
    connector.setHost(host);

    return connector;
  }