成都没有派对🎉

  • 首页
  • 请我喝茶
  • 蛤?
No Party For ChengDu
  1. 首页
  2. 未分类
  3. 正文

Idea连接Mysql错误:javax.net.ssl.SSLHandshakeException connecting to mysql

2021年7月1日 2723点热度 0人点赞 0条评论

错误提示:

[08S01]
Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate).

事件起因

当升级到Idea 2021.1之后,之前正常连接mysql的Database就报错了,提示SSL协议错误。

错误原因

根据jetbrains官方解释:我们最近更新了 java,出于安全原因,我们已将 TLSv1 转移到 jdk.tls.disabledAlgorithms.

总的来说就是,升级后的Idea自带的java运行环境启用了老的TLS协议。

解决方案

1.新建名为custom.java.security的文件,并且编辑为以下内容:

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

2.在Idea中,点击Help-Edit Custom VM Options,新增以下内容

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

其中${PATH_TO_FILE?}是上一步文件的位置,比如说刚才你在D盘目录下新建的,则

-Djava.security.properties=D:/custom.java.security

3.保存,重启

官方解决链接

Can't connect to remote MySQL since last version of IntelliJ : DBE-13313 (jetbrains.com)

本作品采用 知识共享署名 4.0 国际许可协议 进行许可
标签: 暂无
最后更新:2021年7月1日

suxiaomi

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

COPYRIGHT © 2023 成都没有派对🎉. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang