xxl-job执行java任务报错: unable to find valid certification path to requested target

1、错误:xxl-job调用https接口显示证书验证失败

[错误信息:sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]
2023-10-20 15:51:41 [com.xxl.job.core.thread.JobThread#run]-[164]-[Thread-4289]
2、问题是java的ssl证书不能自动引入。
3、处理:手动导入ca.pem证书到java
服务器上手动导入ca.pem
find / -name cacerts
keytool -import -alias clientkey -file ca.pem -keystore /java/jdk1.8.0_11/jre/lib/security/cacerts -trustcacerts
密码:changeit
输入:yes

--注释:
输入以下命令 keytool -import -aliias [证书名字] -keystore [cacerts路径] -file [证书地址] 即可。

keytool -import -alias clientkey -file C:\ssl\xxx.pem -keystore D:\jdks\1.8\jre\lib\security\cacerts -trustcacerts

4、重新启动java服务,再次执行任务成功

 

  

  

posted @ 2023-10-20 16:13  苍茫宇宙  阅读(129)  评论(0编辑  收藏  举报