本文主要是介绍javax.net.ssl.SSLException: closing inbound before receiving peer‘s close_notify异常解决方案,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
javax.net.ssl.SSLException: closing inbound before receiving peer‘s close_notify异常解决方案
** BEGIN NESTED EXCEPTION **javax.net.ssl.SSLException
MESSAGE: closing inbound before receiving peer's close_notifySTACKTRACE:javax.net.ssl.SSLException: closing inbound before receiving peer's close_notifyat sun.security.ssl.Alert.createSSLException(Alert.java:133)at sun.security.ssl.Alert.createSSLException(Alert.java:117)at sun.security.ssl.TransportContext.fatal(TransportContext.java:340)at sun.security.ssl.TransportContext.fatal(TransportContext.java:296)at sun.security.ssl.TransportContext.fatal(TransportContext.java:287)at sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:737)at sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:716)at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:2193)at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4297)at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1519)at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:186)at com.alibaba.druid.filter.stat.StatFilter.connection_close(StatFilter.java:261)at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:181)at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.close(ConnectionProxyImpl.java:115)at com.alibaba.druid.pool.DruidDataSource.close(DruidDataSource.java:1800)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:337)at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:271)at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:571)at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:543)at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:954)at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:504)at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:961)at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1041)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:563)at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:780)at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412)at org.springframework.boot.SpringApplication.run(SpringApplication.java:333)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1277)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1265)at io.renren.AdminApplication.main(AdminApplication.java:15)** END NESTED EXCEPTION **
产生原因
- 安装的是mysql8.0的版本,远程连接发现需要做ssl身份验证,本机连接不需要,取消掉其ssl身份验证需要调整配置
解决方法
(一)方案一
- 在链接最后面添加
&useSSL=false
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/demo?serverTimezone=UTC&useSSL=false", "root", "root");
(二)方案二
- 如果想要在数据库里面关闭ssl验证,需要修改配置文件
①、查看是否开启SSL
SHOW VARIABLES LIKE '%ssl%';
②、如果开启就修改配置文件
- 在ubuntu 下的 /etc/mysql/mysqld.cnf
- windows 下 C:\ProgramData\MySQL\MySQL Server 8.0\目录下的 my.ini 文件
- 在my.ini文件里面的[mysqld]模块添加代码
[mysqld]
skip_ssl
- 增加以上内容 就可以取消掉mysql 的远程访问的ssl身份验证
③、重新启动mysql服务即可
这篇关于javax.net.ssl.SSLException: closing inbound before receiving peer‘s close_notify异常解决方案的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!