Wed Nov 25 11:02:17 GMT+08:00 2020 WARN: Establishing SSL connection without server‘s identity verif

当你碰到:Wed Nov 25 11:02:17 GMT+08:00 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.

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

注意这是个警告,不是错误。
碰到这种情况时证明你已经安装连接成功了,不耽误正常使用,只是建立SSL连接时服务器身份没有验证,不推荐你这样用,所以我们只要在url最后面加上 ?useSSL=false即可。

原先的url:

public static final String url = "jdbc:mysql://127.0.0.1:3306/jdbc_his";

加上?useSSL=false
url更改为:

public static final String url = "jdbc:mysql://127.0.0.1:3306/jdbc_his?useSSL=false";

如果对你有帮助,感谢点赞支持!
如果你是电脑端的话,看到右下角的 “一键三连” 了吗,没错点它[哈哈]

在这里插入图片描述
加油!

共同努力!

Keafmd

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章