Skip to content

Commit

Permalink
Don't reverse-resolve IP addrs for SSL verification and pooling
Browse files Browse the repository at this point in the history
  • Loading branch information
johngmyers committed Mar 3, 2013
1 parent 438afb3 commit 280d3e4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public void operationComplete(ChannelFuture future)
SSLParameters sslParameters = new SSLParameters();
sslParameters.setEndpointIdentificationAlgorithm("HTTPS");

SSLEngine sslEngine = SSLContext.getDefault().createSSLEngine(remoteAddress.getHostName(), remoteAddress.getPort());
SSLEngine sslEngine = SSLContext.getDefault().createSSLEngine(remoteAddress.getHostString(), remoteAddress.getPort());
sslEngine.setSSLParameters(sslParameters);
sslEngine.setUseClientMode(true);

Expand All @@ -307,7 +307,7 @@ private static class PoolKey
if (isSsl) {
// A connection using a hostname that matches the cert shouldn't be
// reused for another hostname that doesn't, so cannot use the IP as key.
hostAndPort = HostAndPort.fromParts(remoteAddress.getHostName(), remoteAddress.getPort());
hostAndPort = HostAndPort.fromParts(remoteAddress.getHostString(), remoteAddress.getPort());
}
else {
String address = InetAddresses.toAddrString(remoteAddress.getAddress());
Expand Down

0 comments on commit 280d3e4

Please sign in to comment.