Skip to content

Commit 07882f3

Browse files
author
oleksiys
committed
[1.9.x] + don't use HostNameVerifier
1 parent 22ad0e3 commit 07882f3

File tree

3 files changed

+3
-135
lines changed

3 files changed

+3
-135
lines changed

src/main/java/com/ning/http/client/providers/grizzly/ConnectionManager.java

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void openAsync(final Request request,
134134
final boolean isSecure = Utils.isSecure(scheme);
135135
endpoint = new AhcEndpoint(partitionId,
136136
isSecure, host, port, request.getLocalAddress(),
137-
createConnectorHandler(isSecure, host));
137+
defaultConnectionHandler);
138138

139139
endpointMap.put(partitionId, endpoint);
140140
}
@@ -168,7 +168,7 @@ Connection openSync(final Request request)
168168
if (endpoint == null) {
169169
endpoint = new AhcEndpoint(partitionId,
170170
isSecure, host, port, request.getLocalAddress(),
171-
createConnectorHandler(isSecure, host));
171+
defaultConnectionHandler);
172172

173173
endpointMap.put(partitionId, endpoint);
174174
}
@@ -177,7 +177,7 @@ Connection openSync(final Request request)
177177

178178
if (c == null) {
179179
final Future<Connection> future =
180-
createConnectorHandler(isSecure, host).connect(
180+
defaultConnectionHandler.connect(
181181
new InetSocketAddress(host, port),
182182
request.getLocalAddress() != null
183183
? new InetSocketAddress(request.getLocalAddress(), 0)
@@ -234,25 +234,6 @@ private static int getPort(final String scheme, final int p) {
234234
return port;
235235
}
236236

237-
private ConnectorHandler<SocketAddress> createConnectorHandler(
238-
final boolean isSecure, final String host) {
239-
240-
return isSecure && config.getHostnameVerifier() != null
241-
? new TCPNIOConnectorHandler(transport) {
242-
243-
@Override
244-
protected void preConfigure(final Connection connection) {
245-
super.preConfigure(connection);
246-
247-
HostnameVerifierListener.assignHostnameVerifyTask(
248-
connection, config.getHostnameVerifier(), host, null);
249-
}
250-
251-
}
252-
: defaultConnectionHandler;
253-
254-
}
255-
256237
private class AhcEndpoint extends Endpoint<SocketAddress> {
257238

258239
private final String partitionId;

src/main/java/com/ning/http/client/providers/grizzly/GrizzlyAsyncHttpProvider.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,6 @@ public void onTimeout(Connection connection) {
287287

288288
final SwitchingSSLFilter sslFilter =
289289
new SwitchingSSLFilter(configurator, defaultSecState);
290-
if (clientConfig.getHostnameVerifier() != null) {
291-
sslFilter.addHandshakeListener(new HostnameVerifierListener());
292-
}
293290
fcb.add(sslFilter);
294291

295292
final AhcEventFilter eventFilter = new

src/main/java/com/ning/http/client/providers/grizzly/HostnameVerifierListener.java

Lines changed: 0 additions & 110 deletions
This file was deleted.

0 commit comments

Comments
 (0)