The Application Layer Protocol Negotiation (ALPN) is an extension for the SSL protocol that helps to make HTTPS connections faster. It was defined together with HTTP/2, and HTTP/2 uses ALPN to create HTTPS connections. As most browsers implement HTTP/2 only over HTTPS, ALPN should be supported by any server or client implementing HTTP/2.

The OpenJDK implements SSL in the sun.security.ssl package. The current implementations in Java 7 and Java 8 do not support ALPN. With Java 9, ALPN will become part of the Java SE standard, i.e. Java 9 will provide native support for ALPN.

As long as Java 9 is not ready, an external SSL library with ALPN support must be used. The Jetty project provides a library with ALPN support for sun.security.ssl.

However, as the SSL implementation is part of the Java runtime, Jetty’s ALPN JAR cannot simply be put into the CLASSPATH. Instead, Java must be started with the parameter -Xbootclasspath/p:alpn-boot-VERSION.jar to overwrite Java’s boot classpath. This only works if Jetty’s ALPN version fits exactly with the OpenJDK version used.

A table of OpenJDK versions and corresponding versions of the ALPN boot JAR can be found here (see table 14.1). Binary versions of the JAR can be downloaded here.