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)
{
String peerHost = channel.socket().getInetAddress().getHostAddress();
String peerHost = channel.socket().getInetAddress().getHostName();
int peerPort = channel.socket().getPort();
SSLEngine engine = sslContextFactory.newSSLEngine(peerHost, peerPort);
engine.setUseClientMode(true);

View File

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