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 keySize < 224, 3DES_EDE_CBC, anon, NULL, include jdk.disabled.namedCurves"
    
  • OK按钮,现在就可以愉快的操作数据库了。

方法三

  • 配置全局的java.security.properties,内容也就是上面那些。不过,此法侵入性太高,不够灵活。这里不详细介绍,感兴趣自己去试试。

好了,以上就是解决开头提到问题的详细方法了。当然,我使用的是方法一,我觉得它够灵活,好配置,好复制。

SSLHandshakeException: No appropriate protocol相关推荐

  1. javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher su 解决办法

    一.发现问题 javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher ...

  2. javax.net.ssl.SSLHandshakeException: No appropriate protocol

    在部署项目到服务器后,测试通联支付的时候发现不行,但是本地又是正常的,打开日志一看,发现报错:javax.net.ssl.SSLHandshakeException: No appropriate p ...

  3. 解决java发邮件错误javax.net.ssl.SSLHandshakeException: No appropriate protocol

    java发送邮件时报以下错误信息: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled ...

  4. SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropri

    [现象] com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failureThe last pa ...

  5. Caused by:javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or ciph

    错误详情: 解决方式: 注释掉SSL3配置文件($JAVA_HOME/jre/lib/security/java.security) 编辑 该文件注释掉红框部分

  6. javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites

    idea连接不上远程的数据库 在数据库设置URL的后面拼接?useSSL=false,操作如图: 报错如下: 拼接操作:

  7. JDK异常处理No appropriate protocol

    异常展示 javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher su ...

  8. 项目启动报错No appropriate protocol (protocol is disabled or cipher suites are inappropriate) 解决办法

    错误描述: 项目启动报错 Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is di ...

  9. IJPay微信退款协议不正确 No appropriate protocol

    目录 问题发现 问题研究 解决方案 问题发现 项目中有微信支付功能,也可以微信退款,因为自己写支付代码比较臃肿,所以用了第三方包IJPay来实现支付和退款功能,它封装了一些第三方支付的方法,比如支付宝 ...

最新文章

  1. mysql数据库压缩备份_MySQL数据库之mysql数据库备份命令分享(mysql压缩数据库备份)...
  2. Vue 打包后打开为空白页面 并且控制台报错‘Failed to load resource: net::ERR_FILE_NOT_FOUND’
  3. C++学习之路 | PTA乙级—— 1016 部分A+B (15分)(精简)
  4. 用vim + xdebug 来追踪thinkphp的执行过程
  5. 获取date等于某一天的第一个id sql_leetcode(sql)之经典困难题合集
  6. linux shell写日志,Linux shell编程之文件内容写入和日志记录
  7. 【代码笔记】iOS-账号,密码记住
  8. 泊松分布的期望和方差
  9. 三阶魔方与四阶魔方总结
  10. 动画基础,3种动画方式
  11. [杂记]LeTeX模板——ppt
  12. OSDI 2014 paper reading
  13. 无公网IP远程黑群晖【内网穿透】
  14. 关于php中的print EOF
  15. Python基础学习_函数数def_返回值及返回值类型_函数块
  16. linux图形界面压缩软件,p7zip 压缩软件 for Linux
  17. Wider Face人脸数据集
  18. 史上超全!Docker命令全集,值得收藏!
  19. 国标GPS坐标转高德坐标java
  20. 指令集对CPU性能的影响

热门文章

  1. mybatis-generator自动生成代码插件使用详解
  2. 如何查看C++ 编译的DLL函数
  3. Bonjour(苹果电脑公司的服务器搜索协议商标名)
  4. 记前端状态管理库Akita中的一个坑
  5. python中字符串和文本处理(很详细)
  6. shell之cut ---sed---awk--sort
  7. 赵丽5500 第一节课
  8. 动物电子标签阅读器识读器L8600系列选型与安装注意事项
  9. 自媒体平台的创作方式有哪些?自媒体平台的选择方法
  10. uni-app项目 医疗