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?

7 Answers 7

38

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

2
  • its works thank you Commented Nov 6, 2024 at 7:57
  • if its helpful please put upvote Commented Nov 7, 2024 at 8:05
26

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

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.

1
  • 2
    this is exactly what worked for me as well.
    – snowe
    Commented Sep 1, 2021 at 19:17
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.

1
  • On my side, I did this and all worked fine with dataGrip client.
    – Neri
    Commented May 18, 2023 at 14:15
4

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.

0
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

0

That's works fine!

FROM openjdk:11                                                                                                         
COPY nci-1.0-SNAPSHOT.jar /tmp                                                                                          
RUN echo "jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, EC keySize < 224" >> $JAVA_HOME/co>WORKDIR /tmp                                                                                                                                                                               
ENTRYPOINT ["java", "-Djava.security.properties=disabled_tlsv1.properties", "-jar", "nci-1.0-SNAPSHOT.jar"]
1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Oct 6, 2024 at 7:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.