@@ -223,38 +223,37 @@ public void start() {
223
223
httpConfig .setSecureScheme ("https" );
224
224
httpConfig .setSecurePort (securePort );
225
225
226
- try (ServerConnector http = new ServerConnector (server , new HttpConnectionFactory (httpConfig ))) {
227
- http .setPort (port );
228
- http .setIdleTimeout (500000 );
229
-
230
- Path keystore = getKeyStore ();
231
- if (!Files .exists (keystore )) {
232
- throw new RuntimeException (
233
- "Cannot find keystore for SSL cert: " + keystore .toAbsolutePath ());
234
- }
235
-
236
- SslContextFactory sslContextFactory = new SslContextFactory ();
237
- sslContextFactory .setKeyStorePath (keystore .toAbsolutePath ().toString ());
238
- sslContextFactory .setKeyStorePassword ("password" );
239
- sslContextFactory .setKeyManagerPassword ("password" );
240
-
241
- HttpConfiguration httpsConfig = new HttpConfiguration (httpConfig );
242
- httpsConfig .addCustomizer (new SecureRequestCustomizer ());
243
-
244
- ServerConnector https = new ServerConnector (
245
- server ,
246
- new SslConnectionFactory (sslContextFactory , HttpVersion .HTTP_1_1 .asString ()),
247
- new HttpConnectionFactory (httpsConfig ));
248
- https .setPort (securePort );
249
- https .setIdleTimeout (500000 );
250
-
251
- server .setConnectors (new Connector []{http , https });
252
-
253
- try {
254
- server .start ();
255
- } catch (Exception e ) {
256
- throw new RuntimeException (e );
257
- }
226
+ ServerConnector http = new ServerConnector (server , new HttpConnectionFactory (httpConfig ));
227
+ http .setPort (port );
228
+ http .setIdleTimeout (500000 );
229
+
230
+ Path keystore = getKeyStore ();
231
+ if (!Files .exists (keystore )) {
232
+ throw new RuntimeException (
233
+ "Cannot find keystore for SSL cert: " + keystore .toAbsolutePath ());
234
+ }
235
+
236
+ SslContextFactory sslContextFactory = new SslContextFactory ();
237
+ sslContextFactory .setKeyStorePath (keystore .toAbsolutePath ().toString ());
238
+ sslContextFactory .setKeyStorePassword ("password" );
239
+ sslContextFactory .setKeyManagerPassword ("password" );
240
+
241
+ HttpConfiguration httpsConfig = new HttpConfiguration (httpConfig );
242
+ httpsConfig .addCustomizer (new SecureRequestCustomizer ());
243
+
244
+ ServerConnector https = new ServerConnector (
245
+ server ,
246
+ new SslConnectionFactory (sslContextFactory , HttpVersion .HTTP_1_1 .asString ()),
247
+ new HttpConnectionFactory (httpsConfig ));
248
+ https .setPort (securePort );
249
+ https .setIdleTimeout (500000 );
250
+
251
+ server .setConnectors (new Connector []{http , https });
252
+
253
+ try {
254
+ server .start ();
255
+ } catch (Exception e ) {
256
+ throw new RuntimeException (e );
258
257
}
259
258
}
260
259
0 commit comments