Custom CA for Java in Docker image
To enable your Java services to talk to other services using a custom CA, you have to use the Java keytool. There is a little bit of digging around involved to get the needed command. Especially the default keystore password took me some time to find, since I guessed the default is a password-less keystore. Well, it is not. The default keystore password is
I love Docker, so I wrapped everything you need to use custom CAs with your Java services in a Docker example. The following
Dockerfile adds a custom CA cert to the Java keystore and runs a simple test to ensure, that everything worked. As prerequisite you must place your CA certificate to next to the Docker file as
# FROM java:8u66-jre
SSLPoke class is originally from here. It creates a test connection against the given domain and port. When you see the output
Successfully connected then everything went fine.