useSSL=false 连接配置详解

您所在的位置:网站首页 fault和false的区别 useSSL=false 连接配置详解

useSSL=false 连接配置详解

2023-07-02 04:25| 来源: 网络整理| 查看: 265

web应用中连接mysql数据库时后台会出现这样的提示:

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在高版本需要指明是否进行SSL连接。

SSL协议提供服务主要: 1)认证用户服务器,确保数据发送到正确的服务器;    . 2)加密数据,防止数据传输途中被窃取使用; 3)维护数据完整性,验证数据在传输过程中是否丢失; 当前支持SSL协议两层: SSL记录协议(SSL Record Protocol):建立靠传输协议(TCP)高层协议提供数据封装、压缩、加密等基本功能支持 SSL握手协议(SSL Handshake Protocol):建立SSL记录协议用于实际数据传输始前通讯双进行身份认证、协商加密 算法、 交换加密密钥等。

解决方案如下: 在mysql连接字符串url中加入ssl=true或者false即可,如下所示。 url=jdbc:mysql://127.0.0.1:3306/framework?useSSL=false



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3