0

I am working right now on improving a Java project built using the IntelliJ IDEA, and this project requires connecting to a local database. The problem is that I can't run it at all because of an exception:

com.microsoft.sqlserver.jdbc.SQLServerException: Le pilote n'a pas pu établir de connexion sécurisée au serveur SQL Server à l'aide du chiffrement SSL (Secure Sockets Layer). Error: « The server selected protocol version TLS10 is not accepted by client preferences [TLS12] ». ClientConnectionId:c1722f06-2f8f-435b-953d-67697967d9a5

I am guessing it might be linked to IntelliJ settings in my computer because my co-worker copied the project too and it worked perfectly for him.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • 1
    Looks like your Java client wants to use TLS 1.0 while the server only supports TLS 1.2. Do you _have_ to use a secured connection for a local database? The DB being local would indicate it's not a production system anyway. Besides that, we need more info, e.g. the Java version you're using (not all support TLS 1.2 out-of-the-box) and how you're trying to establish the connection. – Thomas Oct 26 '21 at 06:36
  • I am using Java 1.8 . I think a should use a secured connexion because if we take a look at the part in french it means this : The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. And for the last one , I don't really understand what you mean by how am I trying to establish the connection ; but what I can say is that I am connecting using a jdbc driver . – El Mehdi Bouddit Oct 26 '21 at 06:42
  • The message states that the secure connection can't be established due to the TLS version mismatch. Please share the code you're using to open the connection, i.e. how you're calling th JDBC driver and which driver you're using. – Thomas Oct 26 '21 at 06:46
  • 1
    Btw, I misread the message: it's the _server_ that seems to only support TLS 1.0 while your Java clients only wants TLS 1.2. This might help: https://stackoverflow.com/questions/67246010/the-server-selected-protocol-version-tls10-is-not-accepted-by-client-preferences – Thomas Oct 26 '21 at 06:48
  • I was thinking maybe it's because I have java 16 and java 13 too , and I checked with my co-worker and he has only java8 so clearly it supports TLS 1.0 . If I'll try to uninstall them , and keep java8 only. – El Mehdi Bouddit Oct 26 '21 at 07:06
  • You don't have to uninstall those Java versions. Just check how to re-enable TLS 1.0, think about upgrading your DB server so it supports TLS 1.2 or just do without a secured connection for local tests. – Thomas Oct 26 '21 at 07:14
  • 1
    Even SQL Server 2008 (before 2008 R2, even) had support for TLS 1.2. [KB3135244 - TLS 1.2 support for Microsoft SQL Server](https://support.microsoft.com/en-us/topic/kb3135244-tls-1-2-support-for-microsoft-sql-server-e4472ef8-90a9-13c1-e4d8-44aad198cdbe). For the love of Pete, please migrate to a newer version of SQL Server. – AlwaysLearning Oct 26 '21 at 13:20

0 Answers0