- int httpPort = Integer.valueOf(params.getProperty("IntHttpPort", "80" ));
- int sslPort = Integer.valueOf(params.getProperty("IntHttpsPort", "443" ));
- boolean allowHttp = Boolean.valueOf(params.getProperty("HttpAllowed", "false"));
- serverLogger.info( "port params: http=" + httpPort + " https=" + sslPort );
- serverLogger.info( "allowHttp=" + allowHttp );
-
- // HTTP Server
- HttpConfiguration http_config = new HttpConfiguration();
- http_config.setSecureScheme("https");
- http_config.setSecurePort(sslPort);
- http_config.setOutputBufferSize(32768);
-
-
-
- try(ServerConnector httpConnector = new ServerConnector(server, new HttpConnectionFactory(http_config))) {
- httpConnector.setPort(httpPort);
- httpConnector.setIdleTimeout(30000);
-
-
- // HTTPS Server
-
- HttpConfiguration https_config = new HttpConfiguration(http_config);
- https_config.addCustomizer(new SecureRequestCustomizer());
- SslContextFactory sslContextFactory = new SslContextFactory();
-
- setUpKeystore(params, sslContextFactory);
- setUpTrustStore(params, sslContextFactory);
-
- if (sslPort != 0) {
- try(ServerConnector sslConnector = new ServerConnector(server,
- new SslConnectionFactory(sslContextFactory, "http/1.1"),
- new HttpConnectionFactory(https_config))) {
+ int httpPort = Integer.valueOf(params.getProperty("IntHttpPort", "80"));
+ int sslPort = Integer.valueOf(params.getProperty("IntHttpsPort", "443"));
+ boolean allowHttp = Boolean.valueOf(params.getProperty("HttpAllowed", "false"));
+ serverLogger.info("port params: http=" + httpPort + " https=" + sslPort);
+ serverLogger.info("allowHttp=" + allowHttp);
+
+ // HTTP Server
+ HttpConfiguration http_config = new HttpConfiguration();
+ http_config.setSecureScheme("https");
+ http_config.setSecurePort(sslPort);
+ http_config.setOutputBufferSize(32768);
+
+ try (ServerConnector httpConnector = new ServerConnector(server, new HttpConnectionFactory(http_config))) {
+ httpConnector.setPort(httpPort);
+ httpConnector.setIdleTimeout(30000);
+
+ // HTTPS Server
+
+ HttpConfiguration https_config = new HttpConfiguration(http_config);
+ https_config.addCustomizer(new SecureRequestCustomizer());
+ SslContextFactory sslContextFactory = new SslContextFactory();
+ sslContextFactory.setWantClientAuth(true);
+
+ setUpKeystore(params, sslContextFactory);
+ setUpTrustStore(params, sslContextFactory);
+
+ if (sslPort != 0) {
+ try (ServerConnector sslConnector = new ServerConnector(server,
+ new SslConnectionFactory(sslContextFactory, "http/1.1"),
+ new HttpConnectionFactory(https_config))) {