Is there a way in Java to specify additional truststore(s), but have java default to the cacerts if no matching certificate is found in the specified truststores? I'm looking to be able to create a truststore with some basic certificates that I need in several applications but without having to update the cacerts file for each jre individually.
I realize that I can just extend the cacerts file (ie: copy it and add to it), but I would rather have a central truststore with just my additional certificates.
I did find this question already asked, but it is several years old, and I don't know if Java 7, 8 or 9 has addressed this issue any differently since.
All the documentation I found points to using javax.net.ssl.trustStore
and pointing it to my new truststore, but this will then ignore everything in my cacerts.
If I point to my keystore with javax.net.ssl.keyStore
, then I can't have an application-specific keystore.
Ideally, I would like to be able to create a list of truststores for java to iterate over.
Does this exist in Java 7+?