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}
This commit is contained in:
Joakim Erdfelt 2014-03-06 13:28:56 -07:00
parent 5d36a4cb73
commit a3e5e0858c
1 changed files with 4 additions and 1 deletions

View File

@ -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);