sslkotlinjettyhttp4k

Configuring SSL for Jetty in http4k


I am trying to make my http4k REST API require SSL but I can't manage to figure out how to configure Jetty for SSL.


Solution

  • Because it supports multiple backends, http4k doesn't come with any inbuilt APIs to implement SSL. Instead, you implement your own custom version of the Jetty ServerConfig interface so configure the server as required. As a template you can use the one here:

    https://github.com/http4k/http4k/blob/master/http4k-server-jetty/src/main/kotlin/org/http4k/server/jetty.kt