From a18c2c49f94aba4a32356af438e0cdc4e9a35a96 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Wed, 3 Apr 2019 19:24:14 +0200 Subject: [PATCH] Issue #3464 - Split SslContextFactory into Client and Server Fixed a couple of places where Server was used instead of Client. Signed-off-by: Simone Bordet --- .../client/TLSServerConnectionCloseTest.java | 3 ++- .../fcgi/server/proxy/TryFilesFilterTest.java | 18 +++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/TLSServerConnectionCloseTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/TLSServerConnectionCloseTest.java index e31911f32c2..6108be5346b 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/TLSServerConnectionCloseTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/TLSServerConnectionCloseTest.java @@ -48,7 +48,8 @@ public class TLSServerConnectionCloseTest private void startClient() throws Exception { - SslContextFactory sslContextFactory = new SslContextFactory.Server(); + SslContextFactory sslContextFactory = new SslContextFactory.Client(); + sslContextFactory.setEndpointIdentificationAlgorithm(null); sslContextFactory.setKeyStorePath("src/test/resources/keystore.jks"); sslContextFactory.setKeyStorePassword("storepwd"); diff --git a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/TryFilesFilterTest.java b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/TryFilesFilterTest.java index afbb714dfaa..6df8d40f8c2 100644 --- a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/TryFilesFilterTest.java +++ b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/TryFilesFilterTest.java @@ -55,12 +55,10 @@ public class TryFilesFilterTest connector = new ServerConnector(server); server.addConnector(connector); - SslContextFactory sslContextFactory = new SslContextFactory.Server(); - sslContextFactory.setKeyStorePath("src/test/resources/keystore.jks"); - sslContextFactory.setKeyStorePassword("storepwd"); - sslContextFactory.setTrustStorePath("src/test/resources/truststore.jks"); - sslContextFactory.setTrustStorePassword("storepwd"); - sslConnector = new ServerConnector(server, sslContextFactory); + SslContextFactory.Server serverSslContextFactory = new SslContextFactory.Server(); + serverSslContextFactory.setKeyStorePath("src/test/resources/keystore.jks"); + serverSslContextFactory.setKeyStorePassword("storepwd"); + sslConnector = new ServerConnector(server, serverSslContextFactory); server.addConnector(sslConnector); ServletContextHandler context = new ServletContextHandler(server, "/"); @@ -71,7 +69,13 @@ public class TryFilesFilterTest context.addServlet(new ServletHolder(servlet), "/*"); - client = new HttpClient(sslContextFactory); + SslContextFactory.Client clientSslContextFactory = new SslContextFactory.Client(); + clientSslContextFactory.setEndpointIdentificationAlgorithm(null); + clientSslContextFactory.setKeyStorePath("src/test/resources/keystore.jks"); + clientSslContextFactory.setKeyStorePassword("storepwd"); + clientSslContextFactory.setTrustStorePath("src/test/resources/truststore.jks"); + clientSslContextFactory.setTrustStorePassword("storepwd"); + client = new HttpClient(clientSslContextFactory); server.addBean(client); server.start();