Thanks Simone for the response.
I tried the example you that pointed, but the result is same.
When I use Ssl ( I added SslSelectChannelConnector for it and provided CA signed certificate), it does not bring the secured pages.
I also tried whitelisted other ssl pages, but no luck.
Please see code below and let me know if I am missing something ?
Also, I extended
SslSelectChannelConnector just to add some logging. I see that it
accept() and open() the connection, but then immediately close() the connection.
Where can I get the logs for connector operations ?
Here is the code that I tried.
Server server = new Server();
SelectChannelConnector connector = new SelectChannelConnector();
connector.setPort(8080);
server.addConnector(connector);
SslSelectChannelConnector ssl_connector = new SslSelectChannelConnector();
ssl_connector.setPort(8443);
SslContextFactory cf = ssl_connector.getSslContextFactory();
cf.setKeyStorePath(".\\cert\\Jetty.jks");
cf.setKeyStoreType(KeyStore.getDefaultType());
//cf.setCertAlias("Jetty");
cf.setKeyStorePassword("password");
cf.setKeyManagerPassword("password");
server.addConnector(ssl_connector);
HandlerCollection handlers = new HandlerCollection();
server.setHandler(handlers);
// Setup proxy servlet
ServletContextHandler context = new ServletContextHandler(handlers, "/", ServletContextHandler.SESSIONS);
ServletHolder proxyServlet = new ServletHolder(ProxyServlet.class);
proxyServlet.setInitParameter("whiteList","
google.com,
www.eclipse.org, localhost");
proxyServlet.setInitParameter("blackList","
google.com/calendar/*,
www.eclipse.org/committers/");
context.addServlet(proxyServlet, "/*");
// Setup proxy handler to handle CONNECT methods
ConnectHandler proxy = new ConnectHandler();
proxy.setWhite(new String[] { "
mail.google.com" });
proxy.addWhite("
www.google.com");
handlers.addHandler(proxy);
server.start();