16

I upgraded DataGrip to 2021.1.2, and now when I run any query I get this response

javax.net.ssl.SSLHandshakeException: The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]

How to resolve this?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Ali Faris
  • 17,754
  • 10
  • 45
  • 70

6 Answers6

33

if you are trying to connect Microsoft Sql server the use the drive

Microsoft SQL Server (jTds)

note : Click on the driver option enter image description here

enter image description here

Hoque MD Zahidul
  • 10,560
  • 2
  • 37
  • 40
23

you need to do the following:

1: create a new file (any where) with the name custom.java.security

2: put the following content in the file

jdk.tls.disabledAlgorithms=SSLv3, TLSv1.1, RC4, DES, MD5withRSA, \
    DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
    include jdk.disabled.namedCurves

3 : open DataGrip -> in your database panel -> select the database you want -> right click -> select Properties -> go to the Advanced tab

4 : in the VM Options field write the following

-Djava.security.properties=${PATH_TO_FILE}/custom.java.security

you need to replace ${PATH_TO_FILE} with the folder path of the file that you created in step 1

don't forget to have \\ instead of one \ in path if you use windows

5 : goto File menu -> select Invalidate Caches... -> click Invalidate And Restart


enter image description here


Credit : https://youtrack.jetbrains.com/issue/DBE-13313

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Ali Faris
  • 17,754
  • 10
  • 45
  • 70
7

The other suggestions did not work for my IntelliJ.

What did the trick for me (while connecting to a MySQL Aurora db) was picking/downloading the "MySQL for 5.1" drivers instead of the default MySQL drivers that IntelliJ selected for me.

Hieron
  • 439
  • 3
  • 10
5

No need to create a file as the accepted answer.

When the error prompts, just open "Data Sources and Drivers":

enter image description here

The original text in "VM options":

"-Djdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, include jdk.disabled.namedCurves"

So just remove TLSv1, TLSv1.1 then apply and reconnect, it will work.

Rick
  • 7,007
  • 2
  • 49
  • 79
3

Try adding TLSv1.1,TLSv1.2,TLSv1.3 to the enabledTLSProtocols setting in the Advanced tab like this: DataGrip Project Preferences

Updating the TLS Protocol on server side should be preferred though.

Max
  • 31
  • 3
1

Find the java.security file on your computer and edit it with any text editor, for example Notepad ++

Find the text jdk.tls.disabledAlgorithms, remove the TLS 1.1 and TLS 1.2 protocols and save the file with the changes

jose lopez
  • 31
  • 3