当前位置:   article > 正文

javax.net.ssl.SSLException: closing inbound before receiving peer‘s close_notify异常解决方案_closing inbound before receiving peer,s close noti

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_notify

STACKTRACE:

javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify
    at 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 **
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46

产生原因

  • 安装的是mysql8.0的版本,远程连接发现需要做ssl身份验证,本机连接不需要,取消掉其ssl身份验证需要调整配置

解决方法

(一)方案一

  • 在链接最后面添加&useSSL=false
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/demo?serverTimezone=UTC&useSSL=false", "root", "root");

  • 1
  • 2

(二)方案二

  • 如果想要在数据库里面关闭ssl验证,需要修改配置文件
①、查看是否开启SSL
SHOW VARIABLES LIKE '%ssl%';
  • 1

在这里插入图片描述

②、如果开启就修改配置文件
  • 在ubuntu 下的 /etc/mysql/mysqld.cnf
  • windows 下 C:\ProgramData\MySQL\MySQL Server 8.0\目录下的 my.ini 文件
  • 在my.ini文件里面的[mysqld]模块添加代码
[mysqld]
skip_ssl
  • 1
  • 2
  • 增加以上内容 就可以取消掉mysql 的远程访问的ssl身份验证
    在这里插入图片描述
③、重新启动mysql服务即可
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/650834
推荐阅读
相关标签
  

闽ICP备14008679号