Configuring HTTP/2

Last modified: 11 May 2022

Code examples: http2-netty, http2-jetty

HTTP/2 is a modern binary duplex multiplexing protocol designed as a replacement for HTTP/1.x.

Jetty, Netty, and Tomcat engines provide HTTP/2 implementations that Ktor can use. However, there are significant differences, and each engine requires additional configuration. Once your host is configured properly for Ktor, HTTP/2 support will be activated automatically.

Key requirements:

  • SSL certificate (can be self-signed)

  • ALPN implementation suitable for a particular engine (see corresponding sections for Netty, Jetty, and Tomcat)