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&useSSL=false&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.
source share