File tree Expand file tree Collapse file tree
httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,18 +163,10 @@ public ClassicHttpResponse execute(
163163 break ;
164164
165165 case HttpRouteDirector .TUNNEL_PROXY : {
166- // The most simple example for this case is a proxy chain
167- // of two proxies, where P1 must be tunnelled to P2.
168- // route: Source -> P1 -> P2 -> Target (3 hops)
169- // fact: Source -> P1 -> Target (2 hops)
170- final int hop = fact .getHopCount () - 1 ; // the hop to establish
171- final boolean secure = createTunnelToProxy (route , hop , context );
172- if (LOG .isDebugEnabled ()) {
173- LOG .debug ("{} tunnel to proxy created." , exchangeId );
174- }
175- tracker .tunnelProxy (route .getHopTarget (hop ), secure );
166+ // Proxy chains are not supported by HttpClient.
167+ // Fail fast instead of attempting an untested tunnel to an intermediate proxy.
168+ throw new HttpException ("Proxy chains are not supported." );
176169 }
177- break ;
178170
179171 case HttpRouteDirector .LAYER_PROTOCOL :
180172 execRuntime .upgradeTls (context );
You can’t perform that action at this time.
0 commit comments