解决报错:The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]

本文主要是介绍解决报错:The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12],希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

>>> 近期更新idea版本到2022.2.3后, 使用idea自带的数据库管理工具连接SQLServer2014数据库时出现问题:

```

[08S01] 驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]”。 ClientConnectionId:ac252ff7-8620-437d-b217-2c03c556ffffThe server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]

```

>>> 连续两天, 搜索了无数的文章亲测无效, 几近放弃...

    然后在 Stack Overflow 搜了下, 找到这么一个答案:  

```

---

Q:

    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?

---

A:

    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

   

```

大致意思是:

1. 需要新建个文件, 建哪自己定, 名为: custom.java.security

2. 把以下内容写到这个文件中(记得别乱加空格):

```

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. 点开idea中的 database 标签,

选择你要设置的数据库软件的设置 (这里是 Microsoft SQL Server ), 找到 Advanced 标签页上的 VM Options 框 (!重要

4. 框中填入 -Djava.security.properties=${PATH_TO_FILE}/custom.java.security ,

    记得把 ${PATH_TO_FILE} 替换成第一步中的 custom.java.security 所在的文件夹路径, 路径可以直接去地址栏复制, 记得复制完把"\"全改为"\\",

    这里打个样:

-Djava.security.properties=D:\\Program Files\\QQ/custom.java.security

    哦对了, 我的jdbc用的是8.2.2 , 在这里查看和设置, 至于是否跟解决此问题有关就不清楚了, 请各位自行尝试

    填完别忘了点 ok

5. 最后 idea 左上角菜单 File ->  Invalidate Caches... ->  Invalidate And Restart

OK, enjoy

最后, 感谢这位 Ali Faris 大佬

这篇关于解决报错:The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/217819

相关文章

golang获取prometheus数据(prometheus/client_golang包)

《golang获取prometheus数据(prometheus/client_golang包)》本文主要介绍了使用Go语言的prometheus/client_golang包来获取Prometheu... 目录1. 创建链接1.1 语法1.2 完整示例2. 简单查询2.1 语法2.2 完整示例3. 范围值

解决java.lang.NullPointerException问题(空指针异常)

《解决java.lang.NullPointerException问题(空指针异常)》本文详细介绍了Java中的NullPointerException异常及其常见原因,包括对象引用为null、数组元... 目录Java.lang.NullPointerException(空指针异常)NullPointer

Android开发中gradle下载缓慢的问题级解决方法

《Android开发中gradle下载缓慢的问题级解决方法》本文介绍了解决Android开发中Gradle下载缓慢问题的几种方法,本文给大家介绍的非常详细,感兴趣的朋友跟随小编一起看看吧... 目录一、网络环境优化二、Gradle版本与配置优化三、其他优化措施针对android开发中Gradle下载缓慢的问

python安装whl包并解决依赖关系的实现

《python安装whl包并解决依赖关系的实现》本文主要介绍了python安装whl包并解决依赖关系的实现,文中通过图文示例介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面... 目录一、什么是whl文件?二、我们为什么需要使用whl文件来安装python库?三、我们应该去哪儿下

MySQL安装时initializing database失败的问题解决

《MySQL安装时initializingdatabase失败的问题解决》本文主要介绍了MySQL安装时initializingdatabase失败的问题解决,文中通过图文介绍的非常详细,对大家的学... 目录问题页面:解决方法:问题页面:解决方法:1.勾选红框中的选项:2.将下图红框中全部改为英

MySQL 中的服务器配置和状态详解(MySQL Server Configuration and Status)

《MySQL中的服务器配置和状态详解(MySQLServerConfigurationandStatus)》MySQL服务器配置和状态设置包括服务器选项、系统变量和状态变量三个方面,可以通过... 目录mysql 之服务器配置和状态1 MySQL 架构和性能优化1.1 服务器配置和状态1.1.1 服务器选项

IDEA编译报错“java: 常量字符串过长”的原因及解决方法

《IDEA编译报错“java:常量字符串过长”的原因及解决方法》今天在开发过程中,由于尝试将一个文件的Base64字符串设置为常量,结果导致IDEA编译的时候出现了如下报错java:常量字符串过长,... 目录一、问题描述二、问题原因2.1 理论角度2.2 源码角度三、解决方案解决方案①:StringBui

mybatis和mybatis-plus设置值为null不起作用问题及解决

《mybatis和mybatis-plus设置值为null不起作用问题及解决》Mybatis-Plus的FieldStrategy主要用于控制新增、更新和查询时对空值的处理策略,通过配置不同的策略类型... 目录MyBATis-plusFieldStrategy作用FieldStrategy类型每种策略的作

Python Jupyter Notebook导包报错问题及解决

《PythonJupyterNotebook导包报错问题及解决》在conda环境中安装包后,JupyterNotebook导入时出现ImportError,可能是由于包版本不对应或版本太高,解决方... 目录问题解决方法重新安装Jupyter NoteBook 更改Kernel总结问题在conda上安装了

Goland debug失效详细解决步骤(合集)

《Golanddebug失效详细解决步骤(合集)》今天用Goland开发时,打断点,以debug方式运行,发现程序并没有断住,程序跳过了断点,直接运行结束,网上搜寻了大量文章,最后得以解决,特此在这... 目录Bug:Goland debug失效详细解决步骤【合集】情况一:Go或Goland架构不对情况二: