Hi Oleg, I figured it out. The TlsConfig option indeed does work if you set it on a custom connection manager that you then supply to HttpAsyncClients::createMinimal. The way the deprecated factory method is doing this internally still appears to be incorrect (since it's just creating a default connection manager).
Additionally, I noticed a breaking ABI change in httpcore 5.3.4. The method signature of a public constructor for ClientH2UpgradeHandler was changed. I'm surprised, because I thought we were using Apache Rat to detect this sort of thing. Maybe I misunderstand the compatibility contract between different versions of httpcore and httpclient. - Ryan On Tue, Apr 8, 2025 at 1:02 PM Oleg Kalnichevski <ol...@apache.org> wrote: > > 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 > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org