If I enable HTTP/2 via UpgradeProtocol, HttpServletRequest.getPart() always returns null. This occurs in my own code as well as in org.apache.catalina.manager.HTMLManagerServlet (so, a *.WAR cannot be deployed if HTTP/2 is enabled). When <UpgradeProtocol...> is commented out, upload works. My connector is <!-- NIO connector with OpenSSL --> <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="200" SSLEnabled="true" compression="on" scheme="https" secure="true"> <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /> <SSLHostConfig honorCipherOrder="false"> <Certificate certificateKeyFile="conf/foo-nopp.pem" certificateFile="conf/foo.pem" type="RSA" /> </SSLHostConfig> </Connector> The failure occurs with either Http11NioProtocol or Http11Nio2Protocol. I'm am running Tomcat 8.5, Java 1.8.0_91, MacOS 10.10.5, and both Chrome 50 and Firefox 46.
This works for me (can't sat anything else really).
Rats. I was afraid that's what I'd be told. Is something wrong with my connector? The cert is self-signed. Does that matter?
No idea at this point. I guess it will be explained eventually.
Hi, I was able to reproduce this issue. I think that we should invoke 'data.arrayOffset() + data.position()' when we fill the data: Index: Http2Parser.java =================================================================== --- Http2Parser.java (revision 1745545) +++ Http2Parser.java (working copy) @@ -561,7 +561,7 @@ } default boolean fill(boolean block, ByteBuffer data, int len) throws IOException { - boolean result = fill(block, data.array(), data.arrayOffset(), len); + boolean result = fill(block, data.array(), data.arrayOffset() + data.position(), len); if (result) { data.position(data.position() + len); } What do you think? Regards, Violeta
Reproducible with: - Clean 9.0.x build - NIO + OpenSSL + HTTP/2 - ~40MB WAR (Spring Pet Clinic) Violeta's patch fixes this so I have applied it to 9.0.x for 9.0.0.M7 onwards and 8.5.x for 8.5.3 onwards.