iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >WARN: Establishing SSL connection without server‘s identity verification is not recommended 的解决方法
  • 187
分享到

WARN: Establishing SSL connection without server‘s identity verification is not recommended 的解决方法

ssljava服务器mysql 2023-09-04 20:09:30 187人浏览 安东尼
摘要

当进行需要连接数据库的操作时,控制台会报下面这种红色警报: Sat Jul 09 14:57:03 CST 2022 WARN: Establishing SSL connection without server's identity v

当进行需要连接数据库的操作时,控制台会报下面这种红色警报:

Sat Jul 09 14:57:03 CST 2022 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.

翻译:

警告:不建议在没有服务器身份验证的情况下建立SSL连接。根据mysql 5.5.45+、5.6.26+和5.7.6+的要求,如果没有设置显式选项,默认必须建立SSL连接。为了符合不使用SSL的现有应用程序,verifyServerCertificate属性被设置为'false'。您需要通过设置useSSL=false显式禁用SSL,或者设置useSSL=true并为服务器证书验证提供信任存储区。

报这个警告的原因主要是JDBC的版本与Mysql的版本不兼容,而MySQL在高版本需要指明是否进行SSL连接。

解决方法:

在mysql连接字符串的url中添加配置 ?useSSL=false即可:

  • useSSL=false        禁用SSL
  • useServerPrepStmts=true        开启预编译功能
String url = "jdbc:mysql://127.0.0.1:3306/db1?useUnicode=true&characterEncoding=utf-8&useSSL=false";

来源地址:https://blog.csdn.net/wangws_sb/article/details/125693746

您可能感兴趣的文档:

--结束END--

本文标题: WARN: Establishing SSL connection without server‘s identity verification is not recommended 的解决方法

本文链接: https://www.lsjlt.com/news/394212.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作