aspose file tools*
The moose likes Security and the fly likes How to chagne truststore property at runtime and let the changed to affect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "How to chagne truststore property at runtime and let the changed to affect" Watch "How to chagne truststore property at runtime and let the changed to affect" New topic
Author

How to chagne truststore property at runtime and let the changed to affect

Mohan rvscas
Ranch Hand

Joined: Jul 03, 2010
Posts: 39
i am trying to change truststore property dynamically. the changes could not be affected at run time until i restart the application.



is there any way to change truststore and let the changes should affect ?
bin chbin
Greenhorn

Joined: Sep 23, 2014
Posts: 1
When you change the javax.net.ssl.trustStore file, please add below code before you send https request:

SSLContext sslContext = SSLContext.getInstance("SSL");

sslContext.init(null, null, null);

HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
I try it with jdk7 and the result is ok
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to chagne truststore property at runtime and let the changed to affect