Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,16 @@ public void cancelled() {
public void completed(final AsyncExecRuntime execRuntime) {
final HttpHost proxy = route.getProxyHost();
tracker.connectProxy(proxy, route.isSecure() && !route.isTunnelled());
if (route.isTunnelled() && execRuntime instanceof InternalH2AsyncExecRuntime) {
if (route.getHopCount() > 2) {
asyncExecCallback.failed(new HttpException("Proxy chains are not supported"));
return;
}
tracker.tunnelTarget(false);
if (route.isLayered()) {
tracker.layerProtocol(route.isSecure());
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("{} connected to proxy", exchangeId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -840,9 +840,12 @@ public CloseableHttpAsyncClient build() {
new H2AsyncMainClientExec(httpProcessor),
ChainElement.MAIN_TRANSPORT.name());

final HttpProcessor proxyConnectHttpProcessor =
new DefaultHttpProcessor(new RequestTargetHost(), new RequestUserAgent(userAgentCopy));

execChainDefinition.addFirst(
new AsyncConnectExec(
new DefaultHttpProcessor(new RequestTargetHost(), new RequestUserAgent(userAgentCopy)),
proxyConnectHttpProcessor,
proxyAuthStrategyCopy,
schemePortResolver != null ? schemePortResolver : DefaultSchemePortResolver.INSTANCE,
authCachingDisabled),
Expand Down Expand Up @@ -971,7 +974,18 @@ public CloseableHttpAsyncClient build() {
}

final MultihomeConnectionInitiator connectionInitiator = new MultihomeConnectionInitiator(ioReactor, dnsResolver);
final InternalH2ConnPool connPool = new InternalH2ConnPool(connectionInitiator, host -> null, tlsStrategyCopy);
final InternalH2ConnPool connPool = new InternalH2ConnPool(
connectionInitiator,
host -> null,
tlsStrategyCopy,
ioEventHandlerFactory,
proxyConnectHttpProcessor,
proxyAuthStrategyCopy,
schemePortResolver != null ? schemePortResolver : DefaultSchemePortResolver.INSTANCE,
authCachingDisabled,
authSchemeRegistryCopy,
credentialsProviderCopy,
defaultRequestConfig);
connPool.setConnectionConfigResolver(connectionConfigResolver);

List<Closeable> closeablesCopy = closeables != null ? new ArrayList<>(closeables) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,7 @@ HttpRoute determineRoute(
final HttpHost httpHost,
final HttpRequest request,
final HttpClientContext clientContext) throws HttpException {
final HttpRoute route = routePlanner.determineRoute(httpHost, request, clientContext);
if (route.isTunnelled()) {
throw new HttpException("HTTP/2 tunneling not supported");
}
return route;
return routePlanner.determineRoute(httpHost, request, clientContext);
}

}
Loading
Loading