The last packet successfully received from the server was 3 milliseconds ago. The last packet sent
作者:互联网
The last packet successfully received from the server was 3 milliseconds ago. The last packet sent successfully to the server was 2 milliseconds ago
caused bymysql连接池报 javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException(javax.net.ssl SSL握手异常,java必然发生证明异常)
SSL是什么
SSL(Secure Sockets Layer 安全套接字协议)
及其继任者传输层安全(Transport Layer Security,TLS)
是为网络通信提供安全及数据完整性的一种安全协议。
TLS与SSL在传输层与应用层之间对网络连接进行加密
MySQL5.7之前的版本,安全性较低,存在任何用户都可以连接上的 test 库,所以官方在5.7版本加大了对隐私的保护。并且采用了默认 useSSL = true值防止对数据库的随意修改,到了8.0版本,仍然保留了SSL,并且默认值为 true,所以只要将 “?useSSL= false” 放在url表名后即可
如
jdbc.url=jdbc:mysql://localhost:3306/test_db?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false
顺便解决了Mysql8.X版本时区问题
不建议在没有服务器身份验证的情况下建立SSL连接,,或者设置useSSL=true并为服务器证书验证提供信任存储(不清楚怎么为服务器证书提供信任存储,自己在本地进行的练习是不会用到这个,所以我们直接设置为false就好)
解决Mysql8小时问题的连接
(之前只看到了The last packet successfully received from the server was 3 milliseconds ago. The last packet sent successfully to the server was 2 milliseconds ago这个报错,没有仔细往下看caused by javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException ,所以一直在排连接时长的错,真是zz)
标签:ago,last,successfully,packet,server,SSL,was 来源: https://blog.csdn.net/m0_49135369/article/details/120335563