Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Jetty 9.3 negotiating to HTTP/1.1 instead of HTTP/2.0


On Tue, Mar 24, 2015 at 4:12 PM, bengreenberg <ben@xxxxxxxxxxxxxxxx> wrote:
> Hi all,
> I'm experimenting with the HTTP/2.0 features of Jetty 9.3 and running into
> an issue I don't understand. I have a server running with the http2 module.
> When I hit it using nghttp, I get a 2.0 connection. However, when I access
> it using Chrome or curl, it is a 1.1 connection. I know curl works for
> HTTP/2.0 because I can see it working when I hit
> The Jetty debug output is similar:
> 2015-03-24 11:08:53.372:DBUG:oejs.session:Scheduler-410424423: Scavenging
> sessions at 1427209733372
> 2015-03-24
> 11:08:54.042:DBUG:oeji.ManagedSelector:qtp1401420256-21-acceptor-0@19c65cdc-ServerConnector@3c5a99da{SSL,[ssl,
> alpn, http/1.1, h2-17, h2-16, h2-15, h2-14, h2]}{}: Queued

The preferred ordering of the server is what above: http/1.1 before h2-17, etc.
If the client offers also http/1.1, then that is preferred by the
server over http/2.

To solve:

* if you are deploying using Jetty as a standalone server, add a
property in start.ini:
alpn.protocols=<comma-separated list of protocols in order of preference>

* if you are using Jetty embedded, make sure that you add the
HTTP2ServerConnectionFactory to the ServerConnector before the

Also remind that you must use JDK 8 (only JDK 8 has the strong enough
ciphers required by HTTP/2).
If you are not, you should see a log like "protocol h2-14 not acceptable".

Simone Bordet
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.

Back to the top