Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
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.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.