In my org we have services that use self-signed SSL certificates. When I want to connect to these services from a dockerized Java application running on Kubernetes I need to provide the public key of those services to the Java TrustStore, otherwise I get a SSLHandshakeException
.
I see two options to provide those public keys to the Java TrustStore:
- Incorporate the public key in the Dockerfile
- Provide the public key as ConfigMap and mount it as a volume to a container (see this answer)
Are there any other options? In my opinion option 2 would be more flexible as I wouldn't have to rebuild the docker image when I need to replace the public key and I wouldn't have to modify all Dockerfiles of services that connect to the services with the self-signed certificates, or am I missing something?