protected void configureContext(ServletContextHandler context) {
ServletHolder servletHolder = createProvidingServletHolder();
context.addServlet(servletHolder, path + "/*");
HttpConfiguration http_config = new HttpConfiguration();
ServerConnector http = new ServerConnector(server,
new HttpConnectionFactory(http_config));
http.setPort(port);
if (secure) {
http_config.setSecureScheme("https");
http_config.setSecurePort(8443);
http_config.setOutputBufferSize(32768);
final KeyStore keystore = getKeyStore();
SslContextFactory sslContextFactory = new SslContextFactory(true);
sslContextFactory.setKeyStore(keystore);
sslContextFactory.setCertAlias("jetty");
sslContextFactory.setKeyStorePassword("ignored");
sslContextFactory.setKeyManagerPassword("ignored");
sslContextFactory.setTrustAll(true);
HttpConfiguration https_config = new HttpConfiguration(http_config);
https_config.addCustomizer(new SecureRequestCustomizer());
ServerConnector https = new ServerConnector(server,
new SslConnectionFactory(sslContextFactory, "http/1.1"),
new HttpConnectionFactory(https_config));
https.setPort(port);