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