We currently have a bean definition below to install javax.net.ssl.trustStore
<bean id="trustStore" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" value="#{@systemProperties}" />
<property name="targetMethod" value="putAll" />
<property name="arguments">
<props>
<prop key="javax.net.ssl.trustStore">../path_to/cacerts</prop>
<prop key="javax.net.ssl.trustStorePassword">changeit</prop>
</props>
</property>
</bean>
Is it possible to install javax.net.ssl.trustStore at runtime?
I understand that there is something like:
System.setProperty("javax.net.ssl.trustStore", "D:/cacerts");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
The problem I encountered with this implementation is that when making changes to the "cacerts" file, such a change will not be reflected if the application is not restarted. I would like to know if there is a way to do this dynamically.
We have a function that changes the "cacerts".
I tried to learn this link, but it's hard for me to understand the logic.
http://java.dzone.com/articles/dynamic-property-management
PS: I'm still new to spring.
Hooray!
source