SSLHandshakeException: No appropriate protocol
最编程
2024-03-25 07:55:01
...
SSLHandshakeException: No appropriate protocol
最近 很多 询问关于 DataGrip或其他
JetBrains`家IDE的MySQL数据库配置中报错的问题。具体的报错信息大概是这样的:
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) The following required algorithms might be disabled: SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, include jdk.disabled.namedCurves. Edit the list of disabled algorithms to include required algorithms. You can try to enable TLSv1 or TLSv1.1 first. JDBC driver may have disabled TLS 1.1 and its earlier versions.
这个问题我在IDE更新至2021.2
配置数据库时也曾遇到过,当时随手给解决了,以为这个问题并不需要记录。
故而我做了个决定(并不违背祖宗):把我解决问题的办法记录下来,以供大家参考。
方法一
建立一个文件(我放在~/.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
在IDE配置数据源时,点击Advanced
选项卡,在VM options:
中输入(其中=
后填写上面那个绝对路径):
"-Djava.security.properties=${HOME}/.custom.java.security"
点OK
按钮,现在就可以愉快的操作数据库了。
方法二
在IDE配置数据源时,点击Advanced选项卡,在VM options:中输入(其实基本就是方法一的文件内容):
"-Djdk.tls.disabledAlgorithms=SSLv3, TLSv1.1, RC4, DES, MD5withRSA, DH keySize < 1024, EC keySi
点OK
按钮,现在就可以愉快的操作数据库了。
方法三
- 配置全局的
java.security.properties
,内容也就是上面那些。不过,此法侵入性太高,不够灵活。这里不详细介绍,感兴趣自己去试试。
好了,以上就是解决开头提到问题的详细方法了。当然,我使用的是方法一
,我觉得它够灵活,好配置,好复制。
推荐阅读
-
已解决 javax.net.ssl.SSLHandshakeException:SSL Handshake Exception 正确解决方案,亲测作品!!!!
-
细胞复苏、体液交换、输血、冷冻protocol - 细胞输血
-
SSLHandshakeException: No appropriate protocol
-
解决出现 javax.net.SSLHandshakeException:PKIX path building failed 或 sun.security.validator.ValidatorException:PKIX 路径构建失败的问题
-
error protocol message tag had invalid wire type
-
前端项目遇到问题:脚本加载失效,显示错误代码 net::ERR_HTTP2_PROTOCOL_ERROR 200
-
使用IPv6调用Java后端接口出错:SocketException: Protocol family unavailable
-
RT-qPCR protocol | RNA定量
-
Internet Group Management Protocol(互联网组管理协议)
-
运输层-可靠数据传输原理:选择重传 Selective Repeat Protocol