Requirements for 4.x
The Netty project consists of various sub-modules. For specific requirements for each sub-module refer to their specific section below.
In general the base functionality of each sub-module requires Java 6+ to run and Java 7+ to compile.
Transport Security (TLS)
Although the HTTP/2 RFC does not require using TLS the RFC does enforce requirements if TLS is in use .
HTTP/2 over TLS mandates the use of ALPN to negotiate the use of the
h2 protocol. ALPN is a fairly new standard and (where possible) Netty supports protocol negotiation via NPN for systems that do not yet support ALPN.
TLS with OpenSSL
This is currently the recommended approach for doing TLS with Netty.
Benefits of using OpenSSL
- Speed: In local testing, we've seen performance improvements of 3x over the JDK. GCM, which is used by the only cipher suite required by the HTTP/2 RFC, is 10-500x faster.
- Ciphers: OpenSSL has its own ciphers and is not dependent on the limitations of the JDK. This allows supporting GCM on Java 7.
- ALPN to NPN Fallback: OpenSSL can support ALPN and NPN simultaneously. The JDK implementation by Netty only supports either ALPN or NPN at any given time and NPN is only supported in JDK 7.
- Java Version Independence: does not require using a different library version depending on the JDK update. This is a limitation of the JDK ALPN and NPN implementation used by Netty.
Requirements for using OpenSSL
- OpenSSL version >= 1.0.2 for ALPN support, or version >= 1.0.1 for NPN.
- netty-tcnative version >= 1.1.33.Fork7 must be on classpath.
- Supported platforms (for netty-tcnative):
windows-x86_64. Supporting other platforms will require manually building netty-tcnative.
If the above requirements are met, Netty will automatically select OpenSSL as the default TLS provider.
See the netty-tcnative wiki.
TLS with JDK (Jetty ALPN/NPN)
If you are not able to use OpenSSL then the alternative is to use the JDK for TLS.
Java does not currently support ALPN or NPN (there is a tracking issue so go upvote it!). For lack of support in the JDK we need to use the Jetty-ALPN (or Jetty-NPN if on Java < 8) bootclasspath extension for OpenJDK. To do this, add a
Xbootclasspath JVM option referencing the path to the Jetty
java -Xbootclasspath/p:/path/to/jetty/alpn/extension.jar ...
Note that you must use the release of the Jetty-ALPN jar specific to the version of Java you are using.
Java 7 does not support the cipher suites recommended by the HTTP2 RFC. To address this we suggest servers use Java 8 where possible or use an alternative JCE implementation such as Bouncy Castle. If this is not practical it is possible to use other ciphers but you need to ensure that the services you intend to call also support these ciphers forbidden by the HTTP/2 RFC and have evaluated the security risks of doing so.
Users should be aware that GCM is very slow (1 MB/s) before Java 8u60. With Java 8u60 GCM is 10x faster (10-20 MB/s), but that is still slow compared to OpenSSL (~200 MB/s), especially with AES-NI support (~1 GB/s). GCM cipher suites are the only suites available that comply with HTTP2's cipher requirements.