You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "ok2c (via GitHub)" <gi...@apache.org> on 2026/08/14 11:30:51 UTC
Re: [PR] RFC 7639 ALPN [httpcomponents-client]
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: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org