custom plugin, but failed to access SQL server - The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]

I am developing a custom plugin, but failed to access SQL server

buil.gradle
     implementation 'com.microsoft.sqlserver:mssql-jdbc:9.4.1.jre8'

Idea Version-2021.2.3
    DriverManager.registerDriver(new com.microsoft.sqlserver.jdbc.SQLServerDriver());
    // connnection
    conn = DriverManager.getConnection(connectStr, user, password);
   
    throw exception " The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12] "


Idea Version-2021.3
    DriverManager.registerDriver(new com.microsoft.sqlserver.jdbc.SQLServerDriver());
    // connnection
    conn = DriverManager.getConnection(connectStr, user, password);

    throw exception " The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12] "


Idea Version-2020.1.2
    DriverManager.registerDriver(new com.microsoft.sqlserver.jdbc.SQLServerDriver());
    // connnection
    conn = DriverManager.getConnection(connectStr, user, password);

    It's OK


I tried many schemes and they all failed

    Option 1: Custom VM Options - delete TSL1
        -Djdk.tls.server.protocols=TLSv1
        -Djdk.tls.client.protocols=TLSv1
        -Djdk.tls.disabledAlgorithms=RC4, DES, MD5withRSA, DH keySize < 1024, EC keySize < 224,anon, NULL

    Option2: delete Djdk.tls.disabledAlgorithms for  “C:\Program Files\Java\jdk1.8.0_301\jre\lib\security\java.security







请先登录再写评论。