use of org.eclipse.jetty.server.Connector in project athenz by yahoo.
the class AthenzJettyContainerTest method testInitContainerOnlyHTTPSPort.
@Test
public void testInitContainerOnlyHTTPSPort() {
System.setProperty(AthenzConsts.ATHENZ_PROP_HTTP_PORT, "0");
System.setProperty(AthenzConsts.ATHENZ_PROP_HTTPS_PORT, "4443");
System.setProperty("yahoo.zms.debug.user_authority", "true");
AthenzJettyContainer container = AthenzJettyContainer.createJettyContainer();
assertNotNull(container);
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"));
}
use of org.eclipse.jetty.server.Connector in project athenz by yahoo.
the class AthenzJettyContainerTest method testInitContainerOnlyHTTPPort.
@Test
public void testInitContainerOnlyHTTPPort() {
System.setProperty(AthenzConsts.ATHENZ_PROP_HTTP_PORT, "4080");
System.setProperty(AthenzConsts.ATHENZ_PROP_HTTPS_PORT, "0");
AthenzJettyContainer container = AthenzJettyContainer.createJettyContainer();
assertNotNull(container);
Server server = container.getServer();
Connector[] connectors = server.getConnectors();
assertEquals(connectors.length, 1);
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 testHttpConnectorsBoth.
@Test
public void testHttpConnectorsBoth() {
System.setProperty(AthenzConsts.ATHENZ_PROP_KEYSTORE_PATH, "src/test/resources/keystore.pkcs12");
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_KEYSTORE_RELOAD_SEC, "3600");
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 testInitContainerInvalidHTTPPort.
@Test
public void testInitContainerInvalidHTTPPort() {
System.setProperty(AthenzConsts.ATHENZ_PROP_HTTP_PORT, "-10");
System.setProperty(AthenzConsts.ATHENZ_PROP_HTTPS_PORT, "4443");
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 testInitContainerInvalidHTTPSPort.
@Test
public void testInitContainerInvalidHTTPSPort() {
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"));
}
Aggregations