<p>I want to set up my web page to make HTTP2 requests to a Jetty API server. I read that browsers will only use the "h2" protocol, that is, HTTP2 with TLS. However, my setup has a kubernetes ingress performing SSL termination, and proxying a cleartext request back to the Jetty server. The dilemma is that I don't think I want to negotiate an "h2" connection using Jetty, because that would require an SSL context on that server.</p>

<p>My question is, will this setup allow a browser to perform HTTP2 requests? If so, what do I need to enable on the Jetty server in order to properly serve HTTP2 requests?</p>

<p>You can configure Jetty to serve clear-text HTTP/2 (also known as <code>h2c</code>), so that your setup will be:</p>

<p><code>browser -- h2 --&gt; kubernetes tls termination -- h2c --&gt; Jetty</code></p>

<p>In order to setup Jetty with clear-text HTTP/2, you just need to enable the <code>http2c</code> module if you are using Jetty as a standalone server, see <a href="http://www.eclipse.org/jetty/documentation/current/http2-enabling.html" rel="nofollow noreferrer">http://www.eclipse.org/jetty/documentation/current/http2-enabling.html</a>.</p>

<p>Alternatively, if you're using Jetty embedded you can look at <a href="https://github.com/eclipse/jetty.project/blob/jetty-9.4.7.v20170914/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2CServer.java" rel="nofollow noreferrer">this example</a>.</p>
