项目警告WARN: Establishing SSL connection without server's identity verification is not recommended

本文解释了MySQL5.5.45及以上版本中关于SSL连接的警告信息,并提供了配置建议。介绍了SSL连接的重要性及其三个主要功能:数据传输的机密性、身份验证机制和消息完整性验证。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

在启动项目是出现上述警告,通过内容得知5.5.45+, 5.6.26+ and 5.7.6+等版本的mysql中不建议在没有服务器验证的情况下进行ssl链接,You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.通过这句话可以得出,如果将useSSL设置为true就必须提供服务器证书,所以我们在配置mysql连接时将useSSL配置为false即可,如下

url: jdbc:mysql://localhost:3306/spring-security?useUnicode=true&characterEncoding=utf-8&characterSetResult=utf-8
&useSSL=false

对于SSL连接的定义及意义如下:

SSL(Secure Socket Layer:安全套接字层)利用数据加密、身份验证和消息完整性验证机制,为基于TCP等可靠连接的应用层协议提供安全性保证。

SSL协议提供的功能主要有:

           1、 数据传输的机密性:利用对称密钥算法对传输的数据进行加密。
           2.、身份验证机制:基于证书利用数字签名方法对服务器和客户端进行身份验证,其中客户端的身份验证是可选的。
           3、 消息完整性验证:消息传输过程中使用MAC算法来检验消息的完整性。

如果用户的传输不是通过SSL的方式,那么其在网络中数据都是以明文进行传输的,而这给别有用心的人带来了可乘之机。所以,现在很多大型网站都开启了SSL功能。同样地,在我们数据库方面,如果客户端连接服务器获取数据不是使用SSL连接,那么在传输过程中,数据就有可能被窃取

开启SSL会影响数据库性能,所以谨慎使用

更多关于SSL的介绍可以参考茁壮的小草的文章:https://www.cnblogs.com/mysql-dba/p/7061300.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值