use of org.glassfish.grizzly.ssl.SSLEngineConfigurator in project graylog2-server by Graylog2.
the class JerseyService method startUpApi.
private void startUpApi() throws Exception {
final boolean startWebInterface = configuration.isWebEnable() && configuration.isRestAndWebOnSamePort();
final List<String> resourcePackages = new ArrayList<>(Arrays.asList(restControllerPackages));
if (startWebInterface) {
resourcePackages.add(RESOURCE_PACKAGE_WEB);
}
final Set<Resource> pluginResources = prefixPluginResources(PLUGIN_PREFIX, pluginRestResources);
final SSLEngineConfigurator sslEngineConfigurator = configuration.isRestEnableTls() ? buildSslEngineConfigurator(configuration.getRestTlsCertFile(), configuration.getRestTlsKeyFile(), configuration.getRestTlsKeyPassword()) : null;
final URI restListenUri = configuration.getRestListenUri();
final URI listenUri = new URI(restListenUri.getScheme(), restListenUri.getUserInfo(), restListenUri.getHost(), restListenUri.getPort(), null, null, null);
apiHttpServer = setUp("rest", listenUri, sslEngineConfigurator, configuration.getRestThreadPoolSize(), configuration.getRestSelectorRunnersCount(), configuration.getRestMaxInitialLineLength(), configuration.getRestMaxHeaderSize(), configuration.isRestEnableGzip(), configuration.isRestEnableCors(), pluginResources, resourcePackages.toArray(new String[0]));
apiHttpServer.start();
LOG.info("Started REST API at <{}>", configuration.getRestListenUri());
if (startWebInterface) {
LOG.info("Started Web Interface at <{}>", configuration.getWebListenUri());
}
}
Aggregations