SQL Ant Task: WARN: establishing an SSL connection without server authentication is not recommended

I am running ant task running some SQL queries on a MySQL-5.7 server and I do not want to use SSL. I am currently using mysql-connector-java-5.1.42.jar to connect to MySQL-5.7 ( v5.7.18-0ubuntu0.16.04.1 )

My SQL properties are as follows

 <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"> 

Unfortunately, the driver does not care about any combination of autoReconnect , useSSL and / or verifyServerCertificate , as mentioned here , here and here .

Exact error

Thu Jun 22 12:20:32 GMT 2017 WARN: Establishing an SSL connection without server authentication is not recommended. In accordance with the requirements of MySQL 5.5.45+, 5.6.26+ and 5.7.6+, an SSL connection should be established by default if no explicit parameter is specified. To match existing non-SSL applications, the verifyServerCertificate property is set to false. You need to either explicitly disable SSL by setting useSSL = false, or set useSSL = true and provide trust storage for verifying the server certificate.

+5
source share
1 answer

How about this:

 <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> 

I assume that ant does not parse connection url properties / does not use them to connect. It seems like a β€œlogical” thing to try using connectionProperty to set individual values

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

+2
source

Source: https://habr.com/ru/post/1269106/


All Articles