A
A
Andrey Strelkov2020-12-27 14:24:09
Java
Andrey Strelkov, 2020-12-27 14:24:09

How to change the supported TLS on the Java side of the JDBC client?

Good afternoon, tell me please, with CentOS 7 I successfully connected to MSSQL server - using JDBC driver (OpenJDK 1.8.0). Everything was successful until the transition to CentOS 8.
In CentOS 8, when trying to connect, an error began to appear

Ошибка SQL (1105): Connecting: com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "The server selected protocol version TLS10 is not accepted by client preferences [TLS12]".


TLS/SSL is not strong in the question, but it looks like the error means that my MSSQL server is waiting for a connection using the TLS1.0 protocol, while the client, represented by the JDBC driver, is trying to establish a connection using TLS1.2, as a result of which the server denies the connection.

If so, it looks like something has changed in OpenJDK in CentOS 8.

What can be done in this case? Probably it would be more correct to bring the MSSQL server to support TLS1.2, or it would be easier to specify something like Java in the face of JDBC so that the connection goes through the TLS1.0 protocol

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ananiev, 2020-12-27
@SaNNy32

Try writing sslProtocol=TLSv1 in the connection string

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question