The following warning message appears when JDBC connects to Mysql database:
Thu Aug 16 16:01:11 CST 2018 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 connection issue for Mysql database, warning that it is not recommended to use SSL connection without server authentication, this problem is only available in MYSQL 5.5.45+, 5.6.26+ and 5.7.6+ versions. The workaround is already stated in the warning:
1. Add useSSL=false to the URL of the database connection; 2. Add useSSL=true to the url and provide the server's authentication certificate. If you just do a test, there is no need to get a certificate, just add a useSSL=false after connecting, for example:
When using Java to connect to JDBC, you can set the value of useSSL to false in the Properties object, but it is the same as writing in the link. Like what
In fact, this doesn't need to be written, but a colleague is lazy, he doesn't know how to read the warning message, so he asked me directly, written for lazy people, haha
|