【发布时间】:2018-03-03 17:22:15
【问题描述】:
您好,我正在尝试使用 java 远程登录我的 MySQL 数据库。我创建了一个需要 SSL 的远程帐户。我按照本指南做到了这一点:https://www.digitalocean.com/community/tutorials/how-to-configure-ssl-tls-for-mysql-on-ubuntu-16-04。
现在,一旦我尝试连接到 DB,Java 就会抛出此错误:
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.
所以我将它添加到我的网址中:
+ "&useSSL=true"
+ "&requireSSL=true";
但现在它需要我给它一个trustStore和一个trustStorePassword。我在哪里或如何找到/创建这些?
顺便说一句,我的 MySQL 服务器正在 VPS ubuntu 服务器上运行。
【问题讨论】:
标签: java mysql ssl jdbc keytool