I am using the following code to set my trust store file path and password. However, the default trust store (cacerts) is getting loaded before my system properties are set. Eventually, my trust store does get loaded, but the system does not seem to recognize the certificates in my trust store. I do not want to use -Djavax.net.ssl.trustStore on the command line because I want the path and password to come from the properties file.
System.setProperty("javax.net.ssl.trustStore", path_from_application_properties);
System.setProperty("javax.net.ssl.trustStorePassword", password_from_application_properties);
I've been unable to figure out where in the calling chain the trust store is first loaded and how to get the system properties set before that occurs.
I am using Spring Boot 1.5.4.