SQLServerException: The driver could not establish a secure connection to SQL Server using Secure Sockets Layer (SSL) encryption

3 weeks ago 19
ARTICLE AD BOX

I have an application developped with spring boot and java, I use IDE Eclipse.

This application have to connect to SQLServer database, on a windows server 2012.

On a computer, there is no problem, when I launch the app, the connection is ok.

I have done a new installation of Eclipse in a new computer.

When I try to launch the app I have an error in my console :

com.microsoft.sqlserver.jdbc.SQLServerException: The “encrypt” property has the value “false” and the ‘TrustedServerCertificate’ property has the value “false,” but the driver could not establish a secure connection to SQL Server using Secure Sockets Layer (SSL) encryption: Error: The SQL Server did not return any response. The connection was closed. ClientConnectionId:52ba4e0c-d2e8-4758-96d8-7c68fa6d3c83.

This is what I have in my applications.yml

datasource: jdbcUrl: jdbc:sqlserver://192.168.100.12;databaseName=TEST_PMI;encrypt=false;trustServerCertificate=false

I've tried to change the value of parameter encrypt and trustServerCert to true without success.

My app is launched in Java 21 jdk.

On the web I've found some test to do. I've try to connect on my database on the new computer from "SQL Server Managment Studio". In the test I have an error "the certificate chain was provided by an unauthorized authorithy". After when I checked the option "trusted server certificate", I can established the connection. I don't if thos test can help you.

I don't know what I have to do. I check on the server and there is no certificate.

Can you help me please. I don't know what I have done on the other computer to don't have this problem.

Read Entire Article