I have an SQL Server 2014 updated to the latest fixpack (12.0.5207). In the environment, the only protocol enabled is TLS1.2 (the registry keys has been set for the purpose). I can connect to the SQL server using the SA account both locally and remotely using Management Studio.
However when I try establishing a connection to the SQL server using java code and the JDBC driver sqljdbc42.jar the following exception is thrown:
The driver could not establish a secure connection to SQL Server by
using Secure Sockets Layer (SSL) encryption. Error: "SQL Server did
not return a response. The connection has been closed.
The java code is the following:
public static void main(String[] args)
{
try
{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
}
catch (ClassNotFoundE