use of org.eclipse.jetty.server.Connector in project athenz by yahoo.
the class AthenzJettyContainerTest method initContainerInvalidHTTPSPort.
@Test
public void initContainerInvalidHTTPSPort() {
System.setProperty(AthenzConsts.ATHENZ_PROP_HOME, "/tmp/ATHENZ_server");
System.setProperty(AthenzConsts.ATHENZ_PROP_HTTP_PORT, "4080");
System.setProperty(AthenzConsts.ATHENZ_PROP_HTTPS_PORT, "-10");
AthenzJettyContainer container = AthenzJettyContainer.createJettyContainer();
assertNotNull(container);
Server server = container.getServer();
Connector[] connectors = server.getConnectors();
assertEquals(connectors.length, 2);
assertTrue(connectors[0].getProtocols().contains("http/1.1"));
assertTrue(connectors[1].getProtocols().contains("http/1.1"));
assertTrue(connectors[1].getProtocols().contains("ssl"));
}
use of org.eclipse.jetty.server.Connector in project athenz by yahoo.
the class AthenzJettyContainerTest method testHttpConnectorsBoth.
@Test
public void testHttpConnectorsBoth() {
System.setProperty(AthenzConsts.ATHENZ_PROP_KEYSTORE_PATH, "/tmp/keystore");
System.setProperty(AthenzConsts.ATHENZ_PROP_KEYSTORE_TYPE, "PKCS12");
System.setProperty(AthenzConsts.ATHENZ_PROP_KEYSTORE_PASSWORD, "pass123");
System.setProperty(AthenzConsts.ATHENZ_PROP_TRUSTSTORE_PATH, "/tmp/truststore");
System.setProperty(AthenzConsts.ATHENZ_PROP_TRUSTSTORE_TYPE, "PKCS12");
System.setProperty(AthenzConsts.ATHENZ_PROP_TRUSTSTORE_PASSWORD, "pass123");
System.setProperty(AthenzConsts.ATHENZ_PROP_KEYMANAGER_PASSWORD, "pass123");
System.setProperty(AthenzConsts.ATHENZ_PROP_IDLE_TIMEOUT, "10001");
AthenzJettyContainer container = new AthenzJettyContainer();
container.createServer(100);
HttpConfiguration httpConfig = container.newHttpConfiguration();
container.addHTTPConnectors(httpConfig, 8081, 8082, 0);
Server server = container.getServer();
Connector[] connectors = server.getConnectors();
assertEquals(connectors.length, 2);
assertEquals(connectors[0].getIdleTimeout(), 10001);
assertTrue(connectors[0].getProtocols().contains("http/1.1"));
assertTrue(connectors[1].getProtocols().contains("http/1.1"));
assertTrue(connectors[1].getProtocols().contains("ssl"));
}
use of org.eclipse.jetty.server.Connector in project athenz by yahoo.
the class AthenzJettyContainerTest method testHttpConnectorsHttpOnly.
@Test
public void testHttpConnectorsHttpOnly() {
System.setProperty(AthenzConsts.ATHENZ_PROP_KEYSTORE_PATH, "file:///tmp/keystore");
System.setProperty(AthenzConsts.ATHENZ_PROP_KEYSTORE_TYPE, "PKCS12");
System.setProperty(AthenzConsts.ATHENZ_PROP_KEYSTORE_PASSWORD, "pass123");
System.setProperty(AthenzConsts.ATHENZ_PROP_TRUSTSTORE_PATH, "file:///tmp/truststore");
System.setProperty(AthenzConsts.ATHENZ_PROP_TRUSTSTORE_TYPE, "PKCS12");
System.setProperty(AthenzConsts.ATHENZ_PROP_TRUSTSTORE_PASSWORD, "pass123");
System.setProperty(AthenzConsts.ATHENZ_PROP_KEYMANAGER_PASSWORD, "pass123");
System.setProperty(AthenzConsts.ATHENZ_PROP_IDLE_TIMEOUT, "10001");
AthenzJettyContainer container = new AthenzJettyContainer();
container.createServer(100);
HttpConfiguration httpConfig = container.newHttpConfiguration();
container.addHTTPConnectors(httpConfig, 8081, 0, 0);
Server server = container.getServer();
Connector[] connectors = server.getConnectors();
assertEquals(connectors.length, 1);
assertEquals(connectors[0].getIdleTimeout(), 10001);
assertTrue(connectors[0].getProtocols().contains("http/1.1"));
assertFalse(connectors[0].getProtocols().contains("ssl"));
}
use of org.eclipse.jetty.server.Connector in project athenz by yahoo.
the class AthenzJettyContainerTest method testHttpConnectorsHttpsOnly.
@Test
public void testHttpConnectorsHttpsOnly() {
System.setProperty(AthenzConsts.ATHENZ_PROP_KEYSTORE_PATH, "file:///tmp/keystore");
System.setProperty(AthenzConsts.ATHENZ_PROP_KEYSTORE_TYPE, "PKCS12");
System.setProperty(AthenzConsts.ATHENZ_PROP_KEYSTORE_PASSWORD, "pass123");
System.setProperty(AthenzConsts.ATHENZ_PROP_TRUSTSTORE_PATH, "file:///tmp/truststore");
System.setProperty(AthenzConsts.ATHENZ_PROP_TRUSTSTORE_TYPE, "PKCS12");
System.setProperty(AthenzConsts.ATHENZ_PROP_TRUSTSTORE_PASSWORD, "pass123");
System.setProperty(AthenzConsts.ATHENZ_PROP_KEYMANAGER_PASSWORD, "pass123");
System.setProperty(AthenzConsts.ATHENZ_PROP_IDLE_TIMEOUT, "10001");
AthenzJettyContainer container = new AthenzJettyContainer();
container.createServer(100);
HttpConfiguration httpConfig = container.newHttpConfiguration();
container.addHTTPConnectors(httpConfig, 0, 8082, 0);
Server server = container.getServer();
Connector[] connectors = server.getConnectors();
assertEquals(connectors.length, 1);
assertTrue(connectors[0].getProtocols().contains("http/1.1"));
assertTrue(connectors[0].getProtocols().contains("ssl"));
}
Aggregations