java服务器更换jdk版本后报错:javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is di

发布时间 2023-06-15 10:51:45作者: 穆晟铭

java,服务器更换jdk版本后报错:

Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)

  


然后数据库出现:

### Error querying database.  Cause: java.lang.reflect.UndeclaredThrowableException
### The error may exist in class path resource [mapper/sys/SysDictMapper.xml]
### The error may involve com.variflight.xzair.common.dao.sys.ISysDictMapper.queryAvailableDict
### The error occurred while executing a query

  

原本好好的项目,服务器换了java的jdk版本后,

结果一启动就报这个错:

javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)

网上找了很多文章,有的说tomcat依赖包冲突,有的说这个文件要改\jre\lib\security\java.security,经过测试都没有用

多次失败后我发现可能和连接 mysql 有关系

于是,我在 jdbc-url 中加了 &useSSL=false,居然不报错了

但是为什么从前的也是同样的配置并没有报错呢,我想到了jdk版本,于是我我换了jdk试,果然的不出我所料,换了jdk版本就不需要加 &useSSL=false 

最后得出结论,之前的jdk版本默认不使用SSL连接mysql,而我现在电脑上的版本默认使用SSL链接mysql,所以需要指定不使用SSL

解决办法:

&useSSL=false 

  

当前版本是1.8.0_291,之前的版本是1.8.0_161




来源:https://www.jianshu.com/p/611c78f68469