I have a Java/tomcat base application that uses the standard JDK SSL API. To simplify the keystore management I would like to have 2 trust keystore files that are merged. One from the Oracle JDK ($JAVA_HOME/lib/security/cacerts) and one specific to my company. In Java 8 it is possible to use multiple keystores by using a DKS keystore type.
I've configured ssl-keystore-test.dks with the following content:
domain app1 {
keystore app1-truststore
keystoreType="JKS"
keystoreURI="file:///opt/myapp/testkeystore.jks";
keystore system-truststore
keystoreURI="${java.home}/lib/security/cacerts";
};
When I try to list the certificates from the keystore I receive the following error:
# /opt/jdk1.8/jre/bin/keytool -list -keystore ssl-keystore-test.dks -storetype dks -storepass changeit
keytool error: java.lang.UnsupportedOperationException: This keystore must be loaded using a DomainLoadStoreParameter
What is the proper way to merge at runtime 2 keystores if you do not have access to change the application?