From a3e5e0858cf9262672735aa1d54fbcac725591dc Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 6 Mar 2014 13:28:56 -0700 Subject: [PATCH] 428595 - JSR-356 / ClientContainer does not support SSL + Default SslContextFactory initialized + Setting for trustAll configurable via System property "org.eclipse.jetty.websocket.jsr356.ssl-trust-all"={bool} --- .../org/eclipse/jetty/websocket/jsr356/ClientContainer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/ClientContainer.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/ClientContainer.java index aa395eb5762..6ba4d2284fa 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/ClientContainer.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/ClientContainer.java @@ -41,6 +41,7 @@ import javax.websocket.WebSocketContainer; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; +import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.ShutdownThread; import org.eclipse.jetty.websocket.api.InvalidWebSocketException; import org.eclipse.jetty.websocket.api.extensions.ExtensionFactory; @@ -97,7 +98,9 @@ public class ClientContainer extends ContainerLifeCycle implements WebSocketCont decoderFactory.init(empty); encoderFactory.init(empty); - client = new WebSocketClient(executor); + boolean trustAll = Boolean.getBoolean("org.eclipse.jetty.websocket.jsr356.ssl-trust-all"); + + client = new WebSocketClient(new SslContextFactory(trustAll), executor); client.setEventDriverFactory(new JsrEventDriverFactory(client.getPolicy())); client.setSessionFactory(new JsrSessionFactory(this,this,client)); addBean(client);