Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Mohan rvscas
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic