import org.eclipse.jetty.server.SecureRequestCustomizer;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.server.SessionManager;
import org.eclipse.jetty.server.SslConnectionFactory;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.server.handler.HandlerList;
public class Launcher {
public static void main(String[] args) throws Exception {
+ int port = 443;
+ for (int i = 0; i < args.length; i++) {
+ if (args[i].equals("--port")) {
+ port = Integer.parseInt(args[i + 1]);
+ }
+ i++;
+ }
Server s = new Server();
// === SSL HTTP Configuration ===
HttpConfiguration https_config = new HttpConfiguration();
new SslConnectionFactory(generateSSLContextFactory(),
"http/1.1"), new HttpConnectionFactory(https_config));
connector.setHost("127.0.0.1");
- connector.setPort(443);
+ connector.setPort(port);
s.setConnectors(new Connector[]{connector});
HandlerList hl = new HandlerList();
private static ServletContextHandler generateGigiContext() {
ServletContextHandler servlet = new ServletContextHandler(
ServletContextHandler.SESSIONS);
+ servlet.setInitParameter(SessionManager.__SessionCookieProperty,
+ "CACert-Session");
servlet.addServlet(new ServletHolder(new Gigi()), "/*");
return servlet;
}
}
};
+ scf.setRenegotiationAllowed(false);
scf.setWantClientAuth(true);
KeyStore ks1 = KeyStore.getInstance("pkcs12");
ks1.load(new FileInputStream("config/keystore.pkcs12"),