添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
spring-boot连接mysql警告:Establishing SSL connection without server's identity verification is not ...
最新推荐文章于 2023-01-31 14:49:45 发布
最新推荐文章于 2023-01-31 14:49:45 发布

启动sping-boot项目后,访问mysql数据库警告:

CST 2020 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的url连接串后加上:&useSSL=false

spring.datasource.url=jdbc:mysql://localhost:3306/test?characterEncoding=utf8&useSSL=false
 

注意:如果部署mysql数据库的服务器不支持ssl连接,不要将useSSL设置为true,否则连接数据库会报错:
The last packet successfully received from the server was 28 milliseconds ago. The last packet sent successfully to the server was 28 milliseconds ago.
at sun.reflect.GeneratedConstructorAccessor56.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
at …
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
at …

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 connec... 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 exi 1.完整错误: 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 exist Sun Jan 09 14:19:41 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 optio WARN: Establishing SSL connection without server's identity verification is not recommended 的解决方法 每次从数据库中进行查询或者其他操作控制台都会出现以下警告,虽说不是error,但是很显眼。。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 optio 解决Spring Boot中遇到的“WARN: Establishing SSL connection without server's identity verification is not recommended.”问题 WARN:EstablishingSSLconnectionwithoutserver'sidentityverificationisnotrecommended.AccordingtoMySQL5.5.45+,5.6.26+and5.7.6+requirementsSSLconnectionmustbeestablishedbydefaultifexplicitoptionisn'tset.Forcompliancewithexistin Mon Jun 04 00:53:48 CST 2018 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+ re... 警告:Establishing SSL connection without server’s identity verification is not recommended SpringBoot启东时红色警告: 请注意:不建议在没有服务器身份验证的情况下建立SSL连接。根据MySQL 5.5.45+、5.6.26+和5.7.6+的要求,如果不设置显式选项,则必须建立默认的SSL连... 在启动SpringBoot项目的时候,控制台出现了如下警告,虽然不影响开发,但是每次启动看到这种提示还是很烦的: 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 连接mysql数据库警告Establishing SSL connection without server's identity verification is not recommended.