Search code examples
datagrip

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


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?


Solution

  • 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