Recommended new way to pass in TLSClientAuth in Akka HTTP 10.2 API

Hello, first let me say nice work on the Akka HTTP 10.2 release. The migration has been quite easy, and as an Akka gRPC users, many changes are greatly appreciated. The one question I have is that with the new API to create an HttpsConnectionContext (using either ConnectionContext.httpsServer or ConnectionContext.httpsClient), we are no longer able to pass in the TLSClientAuth parameter to turn on mutual authentication. While the documentation here https://doc.akka.io/docs/akka-http/current/server-side/server-https-support.html mostly details the new API, the section at the bottom for mutual authentication still follows the older API.

Thanks in advance

Thanks for the feedback. Indeed, that was left over.

These kind of settings now need to be applied to the SSLContext/SSLEngine manually:

These old utils show how that was done before:

So, you need to call

engine.setNeedClientAuth(true)

in the new engine creation factory. You can create a context like this:

    // val sslContext: SSLContext = // create manually
    ConnectionContext.httpsServer(() => {
      val engine = sslContext.createSSLEngine()
      engine.setUseClientMode(false)
      engine.setNeedClientAuth(true)
      engine
    })

Would that work for you?

I created #3433 to update the docs.

Yes, this is great. Many thanks @jrudolph!