Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2012-08-03 12:37:58 -0400
committerJoakim Erdfelt2012-08-03 12:37:58 -0400
commit744bd20a448a65df328301894a75fddc9883aed0 (patch)
treec9538edb606b868cad93c0e0d5458815f2533e12 /jetty-websocket
parent03521a9a9936264fd781204de8c67af311d2cf05 (diff)
parente3132d41d8260915ca79c622f6b720a62dbbc635 (diff)
downloadorg.eclipse.jetty.project-744bd20a448a65df328301894a75fddc9883aed0.tar.gz
org.eclipse.jetty.project-744bd20a448a65df328301894a75fddc9883aed0.tar.xz
org.eclipse.jetty.project-744bd20a448a65df328301894a75fddc9883aed0.zip
Merge branch 'jetty-9' of ssh://git.eclipse.org/gitroot/jetty/org.eclipse.jetty.project into jetty-9
Diffstat (limited to 'jetty-websocket')
-rw-r--r--jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java6
-rw-r--r--jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketOverSSLTest.java11
2 files changed, 7 insertions, 10 deletions
diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java
index 9f29e1dad1..01b1a51621 100644
--- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java
+++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java
@@ -21,18 +21,16 @@ import java.nio.channels.SocketChannel;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.atomic.AtomicReference;
-
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLException;
+import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.Connection;
import org.eclipse.jetty.io.EndPoint;
-import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.SelectChannelEndPoint;
import org.eclipse.jetty.io.SelectorManager;
import org.eclipse.jetty.io.ssl.SslConnection;
import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.eclipse.jetty.websocket.api.WebSocketConnection;
import org.eclipse.jetty.websocket.api.WebSocketPolicy;
import org.eclipse.jetty.websocket.client.WebSocketClient;
import org.eclipse.jetty.websocket.client.WebSocketClientFactory;
@@ -146,7 +144,7 @@ public class WebSocketClientSelectorManager extends SelectorManager
{
String peerHost = channel.socket().getInetAddress().getHostAddress();
int peerPort = channel.socket().getPort();
- SSLEngine engine = sslContextFactory.newSslEngine(peerHost,peerPort);
+ SSLEngine engine = sslContextFactory.newSSLEngine(peerHost, peerPort);
engine.setUseClientMode(true);
return engine;
}
diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketOverSSLTest.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketOverSSLTest.java
index 971ff14b7b..5c8ffc2d88 100644
--- a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketOverSSLTest.java
+++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketOverSSLTest.java
@@ -22,7 +22,6 @@ import java.util.concurrent.TimeUnit;
import org.eclipse.jetty.server.SelectChannelConnector;
import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.util.Callback;
import org.eclipse.jetty.util.FutureCallback;
@@ -95,13 +94,13 @@ public class WebSocketOverSSLTest
private void startServer(final Object websocket) throws Exception
{
+ SslContextFactory sslContextFactory = new SslContextFactory();
+ sslContextFactory.setKeyStorePath(MavenTestingUtils.getTestResourceFile("keystore").getAbsolutePath());
+ sslContextFactory.setKeyStorePassword("storepwd");
+ sslContextFactory.setKeyManagerPassword("keypwd");
_server = new Server();
- SelectChannelConnector connector = new SelectChannelConnector(_server,true);
+ SelectChannelConnector connector = new SelectChannelConnector(_server, sslContextFactory);
_server.addConnector(connector);
- SslContextFactory cf = connector.getConnectionFactory().getSslContextFactory();
- cf.setKeyStorePath(MavenTestingUtils.getTestResourceFile("keystore").getAbsolutePath());
- cf.setKeyStorePassword("storepwd");
- cf.setKeyManagerPassword("keypwd");
_server.setHandler(new WebSocketHandler.Simple(websocket.getClass()));
_server.start();
_port = connector.getLocalPort();

Back to the top