diff --git a/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java b/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java index 38b058713bf..a88a23f1ab5 100644 --- a/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java +++ b/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java @@ -19,6 +19,7 @@ import org.eclipse.jetty.ajp.Ajp13SocketConnector; import org.eclipse.jetty.deploy.DeploymentManager; import org.eclipse.jetty.deploy.providers.ContextProvider; import org.eclipse.jetty.deploy.providers.WebAppProvider; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.jmx.MBeanContainer; import org.eclipse.jetty.security.HashLoginService; import org.eclipse.jetty.server.Connector; @@ -70,13 +71,13 @@ public class LikeJettyXml SslSelectChannelConnector ssl_connector = new SslSelectChannelConnector(); ssl_connector.setPort(8443); - ssl_connector.setKeystore(jetty_home + "/etc/keystore"); - ssl_connector.setPassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"); - ssl_connector.setKeyPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g"); - ssl_connector.setTruststore(jetty_home + "/etc/keystore"); - ssl_connector.setTrustPassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"); - ssl_connector.setStatsOn(true); - ssl_connector.setExcludeCipherSuites( + SslContextFactory cf = ssl_connector.getSslContextFactory(); + cf.setKeyStore(jetty_home + "/etc/keystore"); + cf.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"); + cf.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g"); + cf.setTrustStore(jetty_home + "/etc/keystore"); + cf.setTrustStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"); + cf.setExcludeCipherSuites( new String[] { "SSL_RSA_WITH_DES_CBC_SHA", "SSL_DHE_RSA_WITH_DES_CBC_SHA", @@ -86,6 +87,7 @@ public class LikeJettyXml "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA" }); + ssl_connector.setStatsOn(true); server.addConnector(ssl_connector); Ajp13SocketConnector ajp = new Ajp13SocketConnector(); diff --git a/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java b/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java index d60154278a0..95c7b60b45a 100644 --- a/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java +++ b/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java @@ -13,6 +13,7 @@ package org.eclipse.jetty.embedded; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.nio.SelectChannelConnector; @@ -45,9 +46,10 @@ public class ManyConnectors String jetty_home = System.getProperty("jetty.home","../jetty-distribution/target/distribution"); System.setProperty("jetty.home",jetty_home); ssl_connector.setPort(8443); - ssl_connector.setKeystore(jetty_home + "/etc/keystore"); - ssl_connector.setPassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"); - ssl_connector.setKeyPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g"); + SslContextFactory cf = ssl_connector.getSslContextFactory(); + cf.setKeyStore(jetty_home + "/etc/keystore"); + cf.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"); + cf.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g"); server.addConnector(ssl_connector); server.setConnectors(new Connector[] diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/ProxyTunnellingTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/ProxyTunnellingTest.java index 6557f535f4c..096906719eb 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/ProxyTunnellingTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/ProxyTunnellingTest.java @@ -1,10 +1,13 @@ package org.eclipse.jetty.client; -import java.io.File; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import java.io.IOException; import java.net.URLEncoder; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; + import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; @@ -13,6 +16,7 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.HttpHeaders; import org.eclipse.jetty.http.HttpMethods; import org.eclipse.jetty.http.MimeTypes; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.io.ByteArrayBuffer; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Handler; @@ -26,10 +30,6 @@ import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.junit.After; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - public class ProxyTunnellingTest { private Server server; @@ -41,9 +41,10 @@ public class ProxyTunnellingTest { SslSelectChannelConnector connector = new SslSelectChannelConnector(); String keyStorePath = MavenTestingUtils.getTestResourceFile("keystore").getAbsolutePath(); - connector.setKeystore(keyStorePath); - connector.setPassword("storepwd"); - connector.setKeyPassword("keypwd"); + SslContextFactory cf = connector.getSslContextFactory(); + cf.setKeyStore(keyStorePath); + cf.setKeyStorePassword("storepwd"); + cf.setKeyManagerPassword("keypwd"); startServer(connector, handler); } diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/SslContentExchangeTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/SslContentExchangeTest.java index 8e9bf38cbc9..915e17e4e40 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/SslContentExchangeTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/SslContentExchangeTest.java @@ -15,6 +15,7 @@ package org.eclipse.jetty.client; import java.io.File; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.HandlerCollection; @@ -35,9 +36,10 @@ public class SslContentExchangeTest SslSelectChannelConnector connector = new SslSelectChannelConnector(); File keystore = MavenTestingUtils.getTestResourceFile("keystore"); - connector.setKeystore(keystore.getAbsolutePath()); - connector.setPassword("storepwd"); - connector.setKeyPassword("keypwd"); + SslContextFactory cf = connector.getSslContextFactory(); + cf.setKeyStore(keystore.getAbsolutePath()); + cf.setKeyStorePassword("storepwd"); + cf.setKeyManagerPassword("keypwd"); server.addConnector(connector); Handler handler = new TestHandler(getBasePath()); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/SslHttpExchangeTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/SslHttpExchangeTest.java index 1a02ca0c586..df33a0c97ac 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/SslHttpExchangeTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/SslHttpExchangeTest.java @@ -15,6 +15,7 @@ package org.eclipse.jetty.client; import static org.hamcrest.Matchers.*; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ssl.SslSocketConnector; @@ -54,9 +55,10 @@ public class SslHttpExchangeTest extends HttpExchangeTest String keystore = MavenTestingUtils.getTestResourceFile("keystore").getAbsolutePath(); connector.setPort(0); - connector.setKeystore(keystore); - connector.setPassword("storepwd"); - connector.setKeyPassword("keypwd"); + SslContextFactory cf = connector.getSslContextFactory(); + cf.setKeyStore(keystore); + cf.setKeyStorePassword("storepwd"); + cf.setKeyManagerPassword("keypwd"); connector.setAllowRenegotiate(true); _server.setConnectors(new Connector[] diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/SslSecuredContentExchangeTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/SslSecuredContentExchangeTest.java index d890a6ea266..4f3787095af 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/SslSecuredContentExchangeTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/SslSecuredContentExchangeTest.java @@ -20,6 +20,7 @@ import java.util.Set; import org.eclipse.jetty.client.security.Realm; import org.eclipse.jetty.http.security.Constraint; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.security.ConstraintMapping; import org.eclipse.jetty.security.ConstraintSecurityHandler; import org.eclipse.jetty.security.HashLoginService; @@ -61,9 +62,10 @@ extends ContentExchangeTest SslSelectChannelConnector connector = new SslSelectChannelConnector(); File keystore = MavenTestingUtils.getTestResourceFile("keystore"); - connector.setKeystore(keystore.getAbsolutePath()); - connector.setPassword("storepwd"); - connector.setKeyPassword("keypwd"); + SslContextFactory cf = connector.getSslContextFactory(); + cf.setKeyStore(keystore.getAbsolutePath()); + cf.setKeyStorePassword("storepwd"); + cf.setKeyManagerPassword("keypwd"); server.addConnector(connector); File realmPropFile = MavenTestingUtils.getTestResourceFile("realm.properties"); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/SslSecurityListenerTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/SslSecurityListenerTest.java index 1bd6bd196c7..49b714fc501 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/SslSecurityListenerTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/SslSecurityListenerTest.java @@ -34,6 +34,7 @@ import org.eclipse.jetty.client.security.HashRealmResolver; import org.eclipse.jetty.client.security.Realm; import org.eclipse.jetty.http.HttpMethods; import org.eclipse.jetty.http.security.Constraint; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.security.ConstraintMapping; import org.eclipse.jetty.security.ConstraintSecurityHandler; @@ -146,9 +147,10 @@ public class SslSecurityListenerTest extends TestCase String keystore = MavenTestingUtils.getTestResourceFile("keystore").getAbsolutePath(); connector.setPort(0); - connector.setKeystore(keystore); - connector.setPassword("storepwd"); - connector.setKeyPassword("keypwd"); + SslContextFactory cf = connector.getSslContextFactory(); + cf.setKeyStore(keystore); + cf.setKeyStorePassword("storepwd"); + cf.setKeyManagerPassword("keypwd"); _server.setConnectors(new Connector[] { connector }); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/SslValidationTestBase.java b/jetty-client/src/test/java/org/eclipse/jetty/client/SslValidationTestBase.java index da5eae0e8ee..b83ab71a475 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/SslValidationTestBase.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/SslValidationTestBase.java @@ -61,8 +61,10 @@ public abstract class SslValidationTestBase extends SslContentExchangeTest protected void configureClient(HttpClient client) throws Exception { - client.setTrustStoreLocation(_trustpath); - client.setTrustStorePassword(_password); client.setConnectorType(__konnector); + + SslContextFactory cf = client.getSslContextFactory(); + cf.setTrustStore(_trustpath); + cf.setTrustStorePassword(_password); } } diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerConnectSSLTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerConnectSSLTest.java index 4fc43b8633c..1212ca73a6b 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerConnectSSLTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerConnectSSLTest.java @@ -24,6 +24,7 @@ import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.ssl.SslSelectChannelConnector; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; @@ -41,9 +42,10 @@ public class ConnectHandlerConnectSSLTest extends AbstractProxyHandlerTest SslSelectChannelConnector connector = new SslSelectChannelConnector(); String keyStorePath = MavenTestingUtils.getTestResourceFile("keystore").getAbsolutePath(); - connector.setKeystore(keyStorePath); - connector.setPassword("storepwd"); - connector.setKeyPassword("keypwd"); + SslContextFactory cf = connector.getSslContextFactory(); + cf.setKeyStore(keyStorePath); + cf.setKeyStorePassword("storepwd"); + cf.setKeyManagerPassword("keypwd"); startServer(connector, new ServerHandler()); startProxy(); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLEngineTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLEngineTest.java index 3bd6dd33c65..0373a3f3e4f 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLEngineTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLEngineTest.java @@ -44,6 +44,7 @@ import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; @@ -110,9 +111,10 @@ public class SSLEngineTest String keystore = MavenTestingUtils.getTestResourceFile("keystore").getAbsolutePath(); connector.setPort(0); - connector.setKeystore(keystore); - connector.setPassword("storepwd"); - connector.setKeyPassword("keypwd"); + SslContextFactory cf = connector.getSslContextFactory(); + cf.setKeyStore(keystore); + cf.setKeyStorePassword("storepwd"); + cf.setKeyManagerPassword("keypwd"); connector.setRequestBufferSize(512); connector.setRequestHeaderSize(512); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLSelectChannelConnectorLoadTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLSelectChannelConnectorLoadTest.java index 05bc8322d1e..32344768497 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLSelectChannelConnectorLoadTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLSelectChannelConnectorLoadTest.java @@ -14,6 +14,7 @@ import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; + import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocket; import javax.net.ssl.TrustManagerFactory; @@ -21,6 +22,7 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.AbstractHandler; @@ -42,11 +44,12 @@ public class SSLSelectChannelConnectorLoadTest server.addConnector(connector); String keystorePath = System.getProperty("basedir", ".") + "/src/test/resources/keystore"; - connector.setKeystore(keystorePath); - connector.setPassword("storepwd"); - connector.setKeyPassword("keypwd"); - connector.setTruststore(keystorePath); - connector.setTrustPassword("storepwd"); + SslContextFactory cf = connector.getSslContextFactory(); + cf.setKeyStore(keystorePath); + cf.setKeyStorePassword("storepwd"); + cf.setKeyManagerPassword("keypwd"); + cf.setTrustStore(keystorePath); + cf.setTrustStorePassword("storepwd"); server.setHandler(new EmptyHandler()); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslRenegotiateTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslRenegotiateTest.java index b00ec51ccdc..d6ef9e46d01 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslRenegotiateTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslRenegotiateTest.java @@ -12,15 +12,16 @@ import java.nio.channels.SocketChannel; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLEngineResult; +import javax.net.ssl.SSLEngineResult.HandshakeStatus; import javax.net.ssl.SSLProtocolException; import javax.net.ssl.SSLSession; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; -import javax.net.ssl.SSLEngineResult.HandshakeStatus; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.io.nio.IndirectNIOBuffer; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Request; @@ -90,10 +91,11 @@ public class SslRenegotiateTest { String keystore = MavenTestingUtils.getTestResourceFile("keystore").getAbsolutePath(); connector.setPort(0); - connector.setKeystore(keystore); - connector.setPassword("storepwd"); - connector.setKeyPassword("keypwd"); - connector.setAllowRenegotiate(reneg); + SslContextFactory cf = connector.getSslContextFactory(); + cf.setKeyStore(keystore); + cf.setKeyStorePassword("storepwd"); + cf.setKeyManagerPassword("keypwd"); + cf.setAllowRenegotiate(reneg); server.setConnectors(new Connector[] { connector }); server.setHandler(new HelloWorldHandler()); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSelectChannelServerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSelectChannelServerTest.java index 11251cc57d4..1acfa7d9e29 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSelectChannelServerTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSelectChannelServerTest.java @@ -15,20 +15,14 @@ package org.eclipse.jetty.server.ssl; import java.io.FileInputStream; import java.net.Socket; import java.security.KeyStore; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; -import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSession; -import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; -import javax.net.ssl.X509TrustManager; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.server.HttpServerTestBase; import org.junit.BeforeClass; -import org.junit.Test; /** * HttpServer Tester. @@ -52,11 +46,12 @@ public class SslSelectChannelServerTest extends HttpServerTestBase { SslSelectChannelConnector connector = new SslSelectChannelConnector(); String keystorePath = System.getProperty("basedir",".") + "/src/test/resources/keystore"; - connector.setKeystore(keystorePath); - connector.setPassword("storepwd"); - connector.setKeyPassword("keypwd"); - connector.setTruststore(keystorePath); - connector.setTrustPassword("storepwd"); + SslContextFactory cf = connector.getSslContextFactory(); + cf.setKeyStore(keystorePath); + cf.setKeyStorePassword("storepwd"); + cf.setKeyManagerPassword("keypwd"); + cf.setTrustStore(keystorePath); + cf.setTrustStorePassword("storepwd"); connector.setUseDirectBuffers(true); startServer(connector); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSelectChannelTimeoutTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSelectChannelTimeoutTest.java index d0df1ed817d..2da1cace9b4 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSelectChannelTimeoutTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSelectChannelTimeoutTest.java @@ -20,6 +20,7 @@ import java.security.KeyStore; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.server.ConnectorTimeoutTest; import org.junit.BeforeClass; @@ -39,11 +40,12 @@ public class SslSelectChannelTimeoutTest extends ConnectorTimeoutTest SslSelectChannelConnector connector = new SslSelectChannelConnector(); connector.setMaxIdleTime(MAX_IDLE_TIME); //250 msec max idle String keystorePath = System.getProperty("basedir",".") + "/src/test/resources/keystore"; - connector.setKeystore(keystorePath); - connector.setPassword("storepwd"); - connector.setKeyPassword("keypwd"); - connector.setTruststore(keystorePath); - connector.setTrustPassword("storepwd"); + SslContextFactory cf = connector.getSslContextFactory(); + cf.setKeyStore(keystorePath); + cf.setKeyStorePassword("storepwd"); + cf.setKeyManagerPassword("keypwd"); + cf.setTrustStore(keystorePath); + cf.setTrustStorePassword("storepwd"); startServer(connector); KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType()); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketServerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketServerTest.java index 41591838623..c9da61e856d 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketServerTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketServerTest.java @@ -19,6 +19,7 @@ import java.security.KeyStore; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.server.HttpServerTestBase; import org.junit.BeforeClass; import org.junit.Test; @@ -45,11 +46,12 @@ public class SslSocketServerTest extends HttpServerTestBase { SslSocketConnector connector = new SslSocketConnector(); String keystorePath = System.getProperty("basedir",".") + "/src/test/resources/keystore"; - connector.setKeystore(keystorePath); - connector.setPassword("storepwd"); - connector.setKeyPassword("keypwd"); - connector.setTruststore(keystorePath); - connector.setTrustPassword("storepwd"); + SslContextFactory cf = connector.getSslContextFactory(); + cf.setKeyStore(keystorePath); + cf.setKeyStorePassword("storepwd"); + cf.setKeyManagerPassword("keypwd"); + cf.setTrustStore(keystorePath); + cf.setTrustStorePassword("storepwd"); startServer(connector); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketTimeoutTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketTimeoutTest.java index 1d998ed54b0..edcaac7b785 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketTimeoutTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketTimeoutTest.java @@ -20,6 +20,7 @@ import java.security.KeyStore; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.server.ConnectorTimeoutTest; import org.junit.BeforeClass; @@ -39,11 +40,12 @@ public class SslSocketTimeoutTest extends ConnectorTimeoutTest SslSocketConnector connector = new SslSocketConnector(); connector.setMaxIdleTime(MAX_IDLE_TIME); //250 msec max idle String keystorePath = System.getProperty("basedir",".") + "/src/test/resources/keystore"; - connector.setKeystore(keystorePath); - connector.setPassword("storepwd"); - connector.setKeyPassword("keypwd"); - connector.setTruststore(keystorePath); - connector.setTrustPassword("storepwd"); + SslContextFactory cf = connector.getSslContextFactory(); + cf.setKeyStore(keystorePath); + cf.setKeyStorePassword("storepwd"); + cf.setKeyManagerPassword("keypwd"); + cf.setTrustStore(keystorePath); + cf.setTrustStorePassword("storepwd"); startServer(connector); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslUploadTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslUploadTest.java index ed2d096c768..aa98e636392 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslUploadTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslUploadTest.java @@ -31,6 +31,7 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.AbstractHandler; @@ -56,11 +57,12 @@ public class SslUploadTest server.addConnector(connector); String keystorePath = System.getProperty("basedir",".") + "/src/test/resources/keystore"; - connector.setKeystore(keystorePath); - connector.setPassword("storepwd"); - connector.setKeyPassword("keypwd"); - connector.setTruststore(keystorePath); - connector.setTrustPassword("storepwd"); + SslContextFactory cf = connector.getSslContextFactory(); + cf.setKeyStore(keystorePath); + cf.setKeyStorePassword("storepwd"); + cf.setKeyManagerPassword("keypwd"); + cf.setTrustStore(keystorePath); + cf.setTrustStorePassword("storepwd"); server.setHandler(new EmptyHandler()); diff --git a/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java b/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java index 23e75699108..1ae8301bc9a 100644 --- a/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java +++ b/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java @@ -21,6 +21,7 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.eclipse.jetty.http.ssl.SslContextFactory; import org.eclipse.jetty.jmx.MBeanContainer; import org.eclipse.jetty.security.HashLoginService; import org.eclipse.jetty.server.Handler; @@ -99,11 +100,12 @@ public class TestServer SslSelectChannelConnector ssl_connector = new SslSelectChannelConnector(); ssl_connector.setPort(8443); - ssl_connector.setKeystore(jetty_root + "/jetty-server/src/main/config/etc/keystore"); - ssl_connector.setPassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"); - ssl_connector.setKeyPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g"); - ssl_connector.setTruststore(jetty_root + "/jetty-server/src/main/config/etc/keystore"); - ssl_connector.setTrustPassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"); + SslContextFactory cf = ssl_connector.getSslContextFactory(); + cf.setKeyStore(jetty_root + "/jetty-server/src/main/config/etc/keystore"); + cf.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"); + cf.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g"); + cf.setTrustStore(jetty_root + "/jetty-server/src/main/config/etc/keystore"); + cf.setTrustStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"); server.addConnector(ssl_connector); HandlerCollection handlers = new HandlerCollection();