Question

I am writing one java application which connects to database with ssl connection using jTDS. I have added the property ssl=require to the connection URL to enable ssl connection.

But I couldn't find how to configure the properties where I can specify which trust store to use and what is the password for it? All jTDS connection properties are listed here: http://jtds.sourceforge.net/faq.html

SQL server jdbc driver has these kind of properties trustStore and trustStorePassword, per this link: http://technet.microsoft.com/en-us/library/bb879949.aspx

Any idea how to configure ssl connection using jTDS with these properties?

Was it helpful?

Solution

you can specify the trustStore and keyStore location and their password dynamically through Java application as follow:

System.setProperty("javax.net.ssl.trustStore", trustStore file path goes here);
System.setProperty("javax.net.ssl.trustStorePassword", password goes here);

System.setProperty("javax.net.ssl.keyStore", keyStore file path goes here);
System.setProperty("javax.net.ssl.keyStorePassword", password goes here);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top