Our Java servlet connects to a SQL server 2005 database
using the sqljdbc.jar
driver in Tomcat\lib directory
(Windows) and encrypts using SSL with the signed certificate in a keystore. This works fine, but the database has now been migrated to SQL Server 2008 R2
and the connection stopped working. I have successfully created a connection with the credentials using SQL Server Management Studio so the credentials and port number are fine etc. I found using the JTDS driver (version 1.2.7) allowed a successful connection but I cannot get the encryption to work using SSL. I added the JNDI attribute of "ssl=require"
to the URL in the Tomcat JNDI but this still does not work. I also tried "ssl=authenticate"
but again no encryption.
What am I doing wrong? Here is the JNDI entry although with certain information such as password and server nbame hidden.
<Resource auth="Container" driverClassName="net.sourceforge.jtds.jdbc.Driver"
factory="org.moss.jdj.dbcp.EncryptedDataSourceFactory" maxActive="100" maxIdle="30"
maxWait="10000" name="jdbc/edrms" password="*******" type="javax.sql.DataSource"
url="jdbc:jtds:sqlserver://********:2369:\ngedm;databaseName=*******;ssl=require"
username="*******" />