ok2c commented on code in PR #731:
URL: 
https://github.com/apache/httpcomponents-client/pull/731#discussion_r3783288981


##########
httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManager.java:
##########
@@ -552,6 +553,8 @@ public void connect(final ConnectionEndpoint endpoint, 
final TimeValue timeout,
         final HttpHost firstHop = route.getProxyHost() != null ? 
route.getProxyHost() : route.getTargetHost();
         final SocketConfig socketConfig = resolveSocketConfig(route);
         final ConnectionConfig connectionConfig = 
resolveConnectionConfig(route);
+        final TlsConfig tlsConfig = resolveTlsConfig(route.getTargetHost());
+        
HttpClientContext.castOrCreate(context).setHttpVersionPolicy(tlsConfig.getHttpVersionPolicy());

Review Comment:
   @arturobernalg One last bit. Let's do `HttpClientContext#cast` here instead 
and assign the attribute only if the context is non null. There is no point 
creating a new context here. 



##########
httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConnectionManager.java:
##########
@@ -504,13 +505,15 @@ public Future<AsyncConnectionEndpoint> connect(
         if (LOG.isDebugEnabled()) {
             LOG.debug("{} connecting endpoint to {} ({})", 
ConnPoolSupport.getId(endpoint), firstHop, connectTimeout);
         }
+        final TlsConfig targetTlsConfig = 
resolveTlsConfig(route.getTargetHost());
+        
HttpClientContext.castOrCreate(context).setHttpVersionPolicy(targetTlsConfig.getHttpVersionPolicy());

Review Comment:
   @arturobernalg Same



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to