Reputation: 510
in my source code I need to set some properties, Database connection certifications on code level before the database connection establishes.
System.setProperty("javax.net.ssl.trustStorePassword", keystorePassword);
edit - I tried it using java -Djavax.net.ssl.trustStorePassword=yourPassword on runtime, but I want to do it in code level.
Upvotes: 0
Views: 816
Reputation: 4044
I would suggest that you set this with a -D parameter when starting the JVM like in
java -Djavax.net.ssl.trustStorePassword=yourPassword ...
This goes along with the 12-factor-apps and makes your app easier to maintain
Upvotes: 2