Register / Login
Win a copy of
Murach's Python Programming
this week in the
this forum made possible by our volunteer staff, including ...
Roel De Nijs
Stephan van Hulst
Other JSE/JEE APIs
Java main and system setproperty
posted 9 years ago
I am retrieving emails from a mail box using pop3 over SSL. For that purpose I am setting a truststore variable as a system property.
System.clearProperty("javax.net.ssl.trustStore"); Properties p = new Properties(System.getProperties()); p.put("javax.net.ssl.trustStore", "C: cacerts"); System.setProperties(p);
Everything works fine.
But lets say that, in my current executing
, this parameter needs to be altered runtime, to, Say to another certificate file.
System.clearProperty("javax.net.ssl.trustStore"); Properties p = new Properties(System.getProperties()); p.put("javax.net.ssl.trustStore", "C:\\certificates cacerts"); System.setProperties(p);
The program fails to pick up the new certificate file and still refers to the one set the first time.!
I see that this property is being set only once on program initiation. I have to restart the program for any modification to take place.
Any subsequent modification is not being considered.
Is this how this was designed to work or am i missing something?
Any help is appreciated ....
It is sorta covered in the
JavaRanch Style Guide
Boost this thread!
https connection probs
reading a property file
SSL Handshake Issue
SSL Implementation not available
I want to use java properties from an interface