helidon-io / helidon

Java libraries for writing microservices
https://helidon.io
Apache License 2.0
3.48k stars 562 forks source link

[4.1.0] Multiport server configuration with TLS #9044

Open hrstoyanov opened 1 month ago

hrstoyanov commented 1 month ago

Environment Detail s


Problem Description

There is a good example of how to configure a multi-port Helidon SE server using named sockets. However, it does not show or document how to add TLS in such configuration. The below snippet shows how to do it from the command line with global settings, but can be easily be translated into a config.properties/config.yml external file (or even embedded default configuration, if it makes sense). Here is what worked for me:

...
-Dserver.tls.trust.keystore.trust-store=true
-Dserver.tls.trust.keystore.passphrase=changeit
-Dserver.tls.trust.keystore.resource.path=/path/to/my/certs/cacerts.p12
-Dserver.tls.private-key.keystore.passphrase=changeit
-Dserver.tls.private-key.keystore.resource.path=/path/to/my/certs/keys-and-certs.p12
-Dserver.sockets.0.tls.trust.keystore.trust-store=true
-Dserver.sockets.0.tls.trust.keystore.passphrase=changeit
-Dserver.sockets.0.tls.trust.keystore.resource.path=/path/to/my/certs/cacerts.p12
-Dserver.sockets.0.tls.private-key.keystore.passphrase=changeit
-Dserver.sockets.0.tls.private-key.keystore.resource.path=/path/to/my/certs/keys-and-certs.p12 

The above makes sense, and if documented somewhere (maybe just the README.md for the multiport example), it would save someone else a lot of time.

hrstoyanov commented 1 month ago

Please, also see #9041 and #8926 - all in the same neighborhood.