I have a Java project that connects to SQL Server using mssql-jdbc-7.0.0.jre8.jar. When I run the project using "mvn exec:java" the code works just fine. But when I build the project into a jar using "mvn clean compile package" and copy the jdbc jar into the target directory and then try running using "java -jar " I get the error
ERROR connecting to SQL Server: com.microsoft.sqlserver.jdbc.SQLServerException: 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.
Why does it work when not jarred, but doesn't work when jarred?