解決 javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException

phy的部落格發表於2020-09-26
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 1,234 milliseconds ago.  The last packet sent successfully to the server was 1,224 milliseconds ago.
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_161]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_161]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_161]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_161]
Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors

原因:

jdbc:mysql://123.57.17.164:3306/layui?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true

去除&useSSL

jdbc:mysql://123.57.17.164:3306/layui?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8

相關文章