405313 - Websocket client SSL hostname verification is broken, always defaults to raw IP as String

+ After discussion with simone, we have changed from using IP address to
  hostnames in both websocket and spdy.
This commit is contained in:
Joakim Erdfelt 2013-06-14 09:40:49 -07:00
parent d553f9f907
commit 02de232411
2 changed files with 3 additions and 3 deletions

View File

@ -143,7 +143,7 @@ public class SPDYClient
protected SSLEngine newSSLEngine(SslContextFactory sslContextFactory, SocketChannel channel) protected SSLEngine newSSLEngine(SslContextFactory sslContextFactory, SocketChannel channel)
{ {
String peerHost = channel.socket().getInetAddress().getHostAddress(); String peerHost = channel.socket().getInetAddress().getHostName();
int peerPort = channel.socket().getPort(); int peerPort = channel.socket().getPort();
SSLEngine engine = sslContextFactory.newSSLEngine(peerHost, peerPort); SSLEngine engine = sslContextFactory.newSSLEngine(peerHost, peerPort);
engine.setUseClientMode(true); engine.setUseClientMode(true);

View File

@ -104,7 +104,7 @@ public class WebSocketClientSelectorManager extends SelectorManager
} }
catch (IOException e) catch (IOException e)
{ {
LOG.debug(e); LOG.ignore(e);
connectPromise.failed(e); connectPromise.failed(e);
// rethrow // rethrow
throw e; throw e;
@ -120,7 +120,7 @@ public class WebSocketClientSelectorManager extends SelectorManager
public SSLEngine newSSLEngine(SslContextFactory sslContextFactory, SocketChannel channel) public SSLEngine newSSLEngine(SslContextFactory sslContextFactory, SocketChannel channel)
{ {
String peerHost = channel.socket().getInetAddress().getHostAddress(); String peerHost = channel.socket().getInetAddress().getHostName();
int peerPort = channel.socket().getPort(); int peerPort = channel.socket().getPort();
SSLEngine engine = sslContextFactory.newSSLEngine(peerHost,peerPort); SSLEngine engine = sslContextFactory.newSSLEngine(peerHost,peerPort);
engine.setUseClientMode(true); engine.setUseClientMode(true);