From 52d0d6259413fa85dd6a8f09747677c7deada753 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 13 Dec 2018 09:36:13 +1100 Subject: [PATCH] Configure default EndpointIdentificationAlgorithm for WebSocketCoreClient Signed-off-by: Greg Wilkins --- jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml | 2 +- .../java/org/eclipse/jetty/util/ssl/SslContextFactory.java | 2 +- .../jetty/websocket/core/client/WebSocketCoreClient.java | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml index 15694f942a3..0c0356f1d27 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml +++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml @@ -85,9 +85,9 @@ org.eclipse.jetty.plus.webapp.PlusConfiguration org.eclipse.jetty.plus.webapp.EnvConfiguration org.eclipse.jetty.webapp.JmxConfiguration + org.eclipse.jetty.osgi.annotations.AnnotationConfiguration org.eclipse.jetty.websocket.server.JettyWebSocketConfiguration org.eclipse.jetty.websocket.javax.server.JavaxWebSocketConfiguration - org.eclipse.jetty.osgi.annotations.AnnotationConfiguration org.eclipse.jetty.osgi.boot.OSGiWebInfConfiguration org.eclipse.jetty.osgi.boot.OSGiMetaInfConfiguration diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java index 477798d2c8a..efb78890f0a 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java @@ -113,7 +113,7 @@ public class SslContextFactory extends AbstractLifeCycle implements Dumpable }}; private static final Logger LOG = Log.getLogger(SslContextFactory.class); - private static final Logger LOG_CONFIG = LOG.getLogger("config"); + private static final Logger LOG_CONFIG = LOG.getLogger("SslContextFactoryConfig"); public static final String DEFAULT_KEYMANAGERFACTORY_ALGORITHM = (Security.getProperty("ssl.KeyManagerFactory.algorithm") == null ? diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/WebSocketCoreClient.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/WebSocketCoreClient.java index 92f5b97422a..4722d4dfdd5 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/WebSocketCoreClient.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/WebSocketCoreClient.java @@ -52,9 +52,11 @@ public class WebSocketCoreClient extends ContainerLifeCycle implements FrameHand public WebSocketCoreClient() { this(new HttpClient(new SslContextFactory())); - this.httpClient.setName("WSCoreClient"); + // TODO is there more HttpClient configuration we should do by default? + httpClient.getSslContextFactory().setEndpointIdentificationAlgorithm("HTTPS"); + httpClient.setName("WSCoreClient"); // Internally created, let websocket client's lifecycle manage it. - this.addManaged(httpClient); + addManaged(httpClient); } public WebSocketCoreClient(HttpClient httpClient)