[ https://issues.apache.org/jira/browse/CXF-8896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17952645#comment-17952645 ]
Mathieu CARBONNEAUX edited comment on CXF-8896 at 5/19/25 3:09 PM: ------------------------------------------------------------------- the fact to enforce by default to http/2 work fine with https. most of serveur implementation of http/2 on https work fine with the java httpclient... but with http server the http/2 of java http client as many incompatibility with many server implementation... can you enforce http/2 only on https serveur and not on http one ? for example by adding aditional control on "https".equals(uri.getScheme() to enforce automaticly Version.HTTP_1_1 if FORCE_HTTP_VERSION/org.apache.cxf.transport.http.forceVersion is not setted. [https://github.com/jimma/cxf/blob/d17fe348a8153db12508c5efe274d262a7b4d83f/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HttpClientHTTPConduit.java#L266] was (Author: info-apa...@ch2o.info): the fact to enforce by default to http/2 work fine with https. most of serveur implementation of http/2 on https work fine with the java httpclient... but with http server the http/2 of java http client as many incompatibility with many server implementation... can you enforce http/2 only on https serveur and not on http one ? for example in adding aditional control on "https".equals(uri.getScheme() to enforce automaticly Version.HTTP_1_1 if FORCE_HTTP_VERSION/org.apache.cxf.transport.http.forceVersion is not setted. [https://github.com/jimma/cxf/blob/d17fe348a8153db12508c5efe274d262a7b4d83f/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HttpClientHTTPConduit.java#L266] > http client sends some strange HTTP/1.1 and HTTP/2 mix headers > -------------------------------------------------------------- > > Key: CXF-8896 > URL: https://issues.apache.org/jira/browse/CXF-8896 > Project: CXF > Issue Type: Bug > Components: Transports > Affects Versions: 4.0.2 > Reporter: Jim Ma > Priority: Major > Fix For: 4.0.3 > > > From CXF 4.0.1, without the force http version with > > {code:java} > ((BindingProvider)port).getRequestContext().put("org.apache.cxf.transport.http.forceVersion", > "1.1"), {code} > The http client sends request with strange headers : > {code:java} > POST /jaxws-securityDomain2/authz HTTP/1.1 > Connection: Upgrade, HTTP2-Settings > Content-Length: 207 > Host: 127.0.0.1:23088 > HTTP2-Settings: AAEAAEAAAAIAAAABAAMAAABkAAQBAAAAAAUAAEAA > Upgrade: h2c > Accept: */* > Content-Type: text/xml; charset=UTF-8 > SOAPAction: "" > User-Agent: Apache-CXF/4.0.1 {code} > This works in CXF 4.0.0 and this commit seems introduce issue: > [https://github.com/apache/cxf/commit/9b36a4bc996615e0ed02795c74167586a2bb11df] > > If force the HTTP/1.1 with property : > org.apache.cxf.transport.http.forceVersion , it works. But this is a backward > compatible issue and we should still support HTTP/1.1 by default. > > -- This message was sent by Atlassian Jira (v8.20.10#820010)