Hello there,
I'm trying to set up HTTP/2 with TLS in embedded Jetty 10, following this guide:
ALPNServerConnectionFactory doesn't seem to work for me, since it scans for ALPN implementations using ServiceLoader and there is no plain old service declaration file in META-INF/services/*.
JDK9ServerALPNProcessor is on my classpath but I'm not running Jetty on the module path, so no dice..
For this use case, I'm embedding Jetty in a Java agent jar file, so loading it as a module is not exactly a trivial effort.
Was this intentional? It kind of means Jetty 10 cannot be used with ALPN on the classpath?
I tried working around this issue by creating my own NegotiatingServerConnectionFactory subclass which creates a JDK9ServerALPNProcessor directly.
However, when h2 is negotiated, Chrome reports ERR_CONNECTION_CLOSED and curl reports "TLSv1.2 (IN), TLS alert, close notify (256): * Empty reply from server".
On the Jetty side, the following Exception is logged:
Any suggestion on how to proceed?
java.io.IOException: Unconsumed content
at org.eclipse.jetty.server.HttpInput.consumeAll(HttpInput.java:133)
at org.eclipse.jetty.http2.server.HttpChannelOverHTTP2.consumeInput(HttpChannelOverHTTP2.java:687)
at org.eclipse.jetty.http2.server.HttpTransportOverHTTP2.onCompleted(HttpTransportOverHTTP2.java:387)
at org.eclipse.jetty.server.HttpChannel.onCompleted(HttpChannel.java:859)
at org.eclipse.jetty.http2.server.HTTP2ServerConnection$ServerHttpChannelOverHTTP2.onCompleted(HTTP2ServerConnection.java:356)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:384)
at org.eclipse.jetty.server.HttpChannel.run(HttpChannel.java:356)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:137)
at org.eclipse.jetty.http2.HTTP2Connection.produce(HTTP2Connection.java:219)
at org.eclipse.jetty.http2.HTTP2Connection.onFillable(HTTP2Connection.java:166)
at org.eclipse.jetty.http2.HTTP2Connection$FillableCallback.succeeded(HTTP2Connection.java:389)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:528)
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:377)
at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:163)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.SocketChannelEndPoint$1.run(SocketChannelEndPoint.java:106)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:790)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:912)
Cheers,
Eirik.