use of org.mortbay.jetty.security.SslSocketConnector in project Honu by jboulon.
the class ThriftJettyCollector method main.
public static void main(String[] args) throws Exception {
Configuration conf = HonuConfigurationFactory.getInstance().getCollectorConfiguration();
THREADS = conf.getInt("chukwaCollector.http.threads", THREADS);
// Set up jetty connector
int portNum = conf.getInt("chukwaCollector.http.port", 9999);
SelectChannelConnector jettyConnector = new SelectChannelConnector();
jettyConnector.setLowResourcesConnections(THREADS - 10);
jettyConnector.setLowResourceMaxIdleTime(1500);
jettyConnector.setPort(portNum);
int sslPortNum = conf.getInt("chukwaCollector.https.port", 9998);
SslSocketConnector sslConnector = new SslSocketConnector();
sslConnector.setPort(sslPortNum);
sslConnector.setMaxIdleTime(1500);
sslConnector.setKeystore(conf.get("chukwaCollector.keystore"));
sslConnector.setTruststore(conf.get("chukwaCollector.truststore"));
sslConnector.setPassword(conf.get("chukwaCollector.password"));
sslConnector.setKeyPassword(conf.get("chukwaCollector.keyPassword"));
sslConnector.setTrustPassword(conf.get("chukwaCollector.trustPassword"));
// Set up jetty server proper, using connector
jettyServer = new Server(portNum);
jettyServer.setConnectors(new Connector[] { jettyConnector, sslConnector });
org.mortbay.thread.BoundedThreadPool pool = new org.mortbay.thread.BoundedThreadPool();
pool.setMaxThreads(THREADS);
jettyServer.setThreadPool(pool);
// Add the collector servlet to server
Context root = new Context(jettyServer, "/", Context.SESSIONS);
root.addServlet(new ServletHolder(new ThriftServletCollector()), "/*");
jettyServer.start();
jettyServer.setStopAtShutdown(true);
}
use of org.mortbay.jetty.security.SslSocketConnector in project sonatype-aether by sonatype.
the class HttpServer method newHttpsConnector.
protected Connector newHttpsConnector() {
SslSocketConnector connector = new SslSocketConnector();
connector.setPort(httpsPort);
connector.setKeystore(new File(keyStoreLocation).getAbsolutePath());
connector.setPassword(keyStorePassword);
connector.setKeyPassword(keyStorePassword);
connector.setTruststore(new File(trustStoreLocation).getAbsolutePath());
connector.setTrustPassword(trustStorePassword);
connector.setNeedClientAuth(needClientAuth);
return connector;
}
use of org.mortbay.jetty.security.SslSocketConnector in project maven-plugins by apache.
the class ProjectInfoReportUtilsTest method getSSLConnector.
private Connector getSSLConnector() {
SslSocketConnector connector = new SslSocketConnector();
connector.setKeystore(getBasedir() + "/target/jetty.jks");
connector.setPassword("apache");
connector.setKeyPassword("apache");
connector.setTruststore(getBasedir() + "/target/jetty.jks");
connector.setTrustPassword("apache");
return connector;
}
Aggregations