JDBC连接数据库的url设useSSL参数为true产生的问题

Posted 有心有梦

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JDBC连接数据库的url设useSSL参数为true产生的问题相关的知识,希望对你有一定的参考价值。

在此记录一下,我通过JDBC连接mysql数据库,当将连接数据库的url的useSSL参数设置为true时,就无法连接数据库,当设置为false时就可以正常连接

产生的异常信息是:

  Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

  javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors

   java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors

 

先记录一下,日后溯源。

以上是关于JDBC连接数据库的url设useSSL参数为true产生的问题的主要内容,如果未能解决你的问题,请参考以下文章