On Tue, 2025-04-08 at 12:44 -0700, Ryan Schmitt wrote:
> I noticed that there's a regression in httpclient 5.4's support for
> H2C (HTTP/2 over cleartext). Previously, you could create a minimal
> async client with an HttpVersionPolicy of FORCE_HTTP_2, and this
> option would take effect even over non-TLS connections.

Hi Ryan

I am quite sure HttpVersionPolicy set in TlsConfig will apply to non-
TLS connections:

https://github.com/apache/httpcomponents-client/blob/master/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/DefaultAsyncClientConnectionOperator.java#L121

I am aware this can be seen as confusing and I intent to fix it in 5.5

Oleg



>  In 5.4, it
> looks like this option got moved into TlsConfig and is now ignored
> when establishing a plaintext connection. Furthermore, although it's
> possible to call Http1Config.setVersion(HttpVersion.HTTP_2), this
> fails at runtime with an IllegalArgumentException. Is there currently
> any way to configure httpclient 5.4.x for H2C?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
> For additional commands, e-mail: dev-h...@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to