Search in sources :

Example 6 with SSLEngineConfigurator

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());
    }
}
Also used : SSLEngineConfigurator(org.glassfish.grizzly.ssl.SSLEngineConfigurator) ArrayList(java.util.ArrayList) PluginRestResource(org.graylog2.plugin.rest.PluginRestResource) Resource(org.glassfish.jersey.server.model.Resource) URI(java.net.URI)

Aggregations

SSLEngineConfigurator (org.glassfish.grizzly.ssl.SSLEngineConfigurator)6 SSLContextConfigurator (org.glassfish.grizzly.ssl.SSLContextConfigurator)3 URI (java.net.URI)2 HttpServer (org.glassfish.grizzly.http.server.HttpServer)2 ResourceConfig (org.glassfish.jersey.server.ResourceConfig)2 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 InvalidKeyException (java.security.InvalidKeyException)1 KeyStore (java.security.KeyStore)1 CertificateException (java.security.cert.CertificateException)1 ArrayList (java.util.ArrayList)1 NetworkListener (org.glassfish.grizzly.http.server.NetworkListener)1 LoggingFeature (org.glassfish.jersey.logging.LoggingFeature)1 Resource (org.glassfish.jersey.server.model.Resource)1 PluginRestResource (org.graylog2.plugin.rest.PluginRestResource)1 PemKeyStore (org.graylog2.shared.security.tls.PemKeyStore)1