Caused by: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust

这篇博客讨论了在尝试连接到MySQL数据库时遇到的SSL证书验证错误。错误信息表明证书路径无法与信任锚点匹配。解决方案是将URL中的`useSSL=true`改为`useSSL=false`来禁用SSL连接。这适用于临时解决证书问题,但可能不适用于需要安全连接的情况。
摘要由CSDN通过智能技术生成

Caused by: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust

Caused by: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
	at sun.security.provider.certpath.PKIXCertPathValidator.validate(PKIXCertPathValidator.java:153)
	at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.java:79)
	at java.security.cert.CertPathValidator.validate(CertPathValidator.java:292)
	at com.mysql.jdbc.ExportControlled$X509TrustManagerWrapper.checkServerTrusted(ExportControlled.java:295)
	... 28 more

String url=“jdbc:mysql://localhost:3306/jdbcstudy?useUnicode=true&characterEncoding=utf8&useSSL=true;
把SSL=true改成SSL=false就可以了!

————————————————

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值