gpt4 book ai didi

mysql - SQL Ant 任务 : WARN: Establishing SSL connection without server's identity verification is not recommended

转载 作者:可可西里 更新时间:2023-11-01 07:36:28 25 4
gpt4 key购买 nike

我正在运行 ant 任务 在 MySQL-5.7 服务器上执行一些 SQL,但我不想使用 SSL。我目前正在使用 mysql-connector-java-5.1.42.jar 连接到 MySQL-5.7 (v5.7.18-0ubuntu0.16.04.1)

我的 SQL 属性看起来像这样

<sql
url="jdbc:mysql://mysql.box.lan:3306/mydb?autoReconnect=true&amp;useSSL=false&amp;verifyServerCertificate=false"
userid="my-user"
password="xxx"
driver="com.mysql.jdbc.Driver"
onerror="continue"
showWarnings="false"
delimiter=";"
encoding="UTF-8">

不幸的是,驱动程序似乎并不关心autoReconnectuseSSL 和/或verifyServerCertificate 的任何组合,如前所述here , herehere .

确切的错误是

Thu Jun 22 12:20:32 GMT 2017 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.

最佳答案

这个怎么样:

<sql
url="jdbc:mysql://mysql.box.lan:3306/mydb"
userid="my-user"
password="xxx"
driver="com.mysql.jdbc.Driver"
onerror="continue"
showWarnings="false"
delimiter=";"
encoding="UTF-8">
<connectionProperty name="useSSL" value="false" />
<connectionProperty name="verifyServerCertificate" value="false" />
<connectionProperty name="autoReconnect" value="true" />
</sql>

我猜 ant 不解析连接 url 属性/不使用它们进行连接。尝试使用 connectionProperty 设置各个值

似乎是一件“合乎逻辑”的事情

https://ant.apache.org/manual/Tasks/sql.html

关于mysql - SQL Ant 任务 : WARN: Establishing SSL connection without server's identity verification is not recommended,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44699698/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com