doubleyong
管理员
管理员
  • 最后登录2024-04-24
  • 发帖数1167
  • 最爱沙发
  • 喜欢达人
  • 原创写手
  • 社区居民
  • 忠实会员
阅读:295回复:0

[Java EE]使用Spring MVC时提示:WARN: Establishing SSL connection

楼主#
更多 发布于:2024-04-02 09:53
问题:

WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

原因:

在MySQL 5.5.45+、5.6.26+和5.7.6+等版本中,不建议在没有服务器身份验证的情况下建立SSL连接。当然这只是不建议,如果我们非要这么做,也可以无视该警告信息,这只是一个警告信息,不会影响数据库的连接和使用。


解决方案:
只需要在 url 后面加上 useSSL = false 即可如:

 jdbc:mysql://localhost:3306/w333?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&useSSL=false
                        
参考:https://blog.csdn.net/husky_bit/article/details/133379744
知识需要管理,知识需要分享
游客


返回顶部

公众号

公众号