Does anyone have some hints on how to configure a ...
# http4k
c
Does anyone have some hints on how to configure a server(JETTY) to require SSL in http4k?🆘 (edited)
d
http4k doesn't come with support for configuring this type of thing out of the box, but falls back on the APIs supplied by the server vendor. Hence, you need to implement your own version of the stock
ServerConfig
interface, using
Jetty
as an example. Here's the original: https://github.com/http4k/http4k/blob/master/http4k-server-jetty/src/main/kotlin/org/http4k/server/jetty.kt
a
this is quite late -- pick any of the available server backends out of the box with http4k and listen on a specific port (not 80/443), then outside your JAR use Caddy server for all SSL/TLS. Caddy is very easy to configure to forward to your chosen port it's docker-fied if you want, will load-balance, most importantly it is TLS by default and handles auto-setup and renewal of Let's Encrypt certs. You could use Nginx or HAProxy also but Caddy is probably much easier.
👍 1