akka-http
akka-http copied to clipboard
Explore how to reduce the TLS setup
The amount of code to setup HTTPS could be simplified for the most common cases:
- input is a PKCS#12 with all private keys and certificates required
- input are two files: a PKCS#1 private key on a PEM file, and a x.509 certificate on a .crt file.
Deprecating AkkaSSLConfig in Akka 2.6 made this a bit more necessary since the deprecated code:
private val httpsConfig =
AkkaSSLConfig()(system).mapSettings(s =>
s.withTrustManagerConfig(s.trustManagerConfig.withTrustStoreConfigs(Seq(httpsTrustStoreConfig))))
private val httpsContext = http.createClientHttpsContext(httpsConfig)
Now uses two deprecated APIs.
A possible solution would be reusing the PemManagersProvider introduced in https://github.com/akka/akka/pull/29152/files#diff-912cb92888b9d4cc775b16b16c0f8701a67c4329d3fb3e4c3bfb9e5df7ca7839 so building an SSLContext from PEM files becomes a lot simpler.
Case 2 in progress in #4359
Closing this even though we didn't do anything around PKCS#12, let's create a new issue tracking that if we decide it is needed in the future.