java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: PKIX path validation failed

分手后的思念是犯贱 2024-04-03 12:25 120阅读 0赞

背景:写的微信推送公众号消息方法,测试的时候没有收到对应的微信公众号推送

原因:java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: PKIX path validation failed(更多错误信息在后面)

分析:查看日志,发现不是自己写的方法有报错,自己写的方法非常顺畅。而是调用微信接口的推送方法时出现的报错。报错翻译为-“validity check failed 有效性检查失败”。继续查看发现现在时间为2022-10-16,测试那边的时间为2033-10-16,微信那边判定有问题,于是不显示推送。

解决方案:将时间改为现在的时间

图为自己写的代码方法与调用微信的行

5045047416b44d76b91651d967e445ed.png

639679333a224e79be27304fd9628f2c.png

  1. 2033-10-16 09:51:18.556 TID:27c2ee76cb854279871a33a64f2ee0f5.139.20130402779750427 [Credit-Async-6] ERROR c.t.c.c.s.system.WechatMessagePushServiceImpl:76 - 发送用户审核结果失败,json= [{"name":"first","value":"尊敬的客户,您好。"},{"name":"keyword1","value":"陈科可可可"},{"name":"keyword2","value":"2033-10-16"},{"name":"keyword3","value":"600.00"},{"name":"keyword4","value":"2202202210143"},{"name":"keyword5"},{"color":"#173177","name":"remark","value":"祝您生活愉快!"}]
  2. java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
  3. at me.chanjar.weixin.mp.api.impl.WxMpServiceHttpClientImpl.getAccessToken(WxMpServiceHttpClientImpl.java:100)
  4. at me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl.executeInternal(BaseWxMpServiceImpl.java:337)
  5. at me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl.execute(BaseWxMpServiceImpl.java:302)
  6. at me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl.post(BaseWxMpServiceImpl.java:281)
  7. at me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl.post(BaseWxMpServiceImpl.java:286)
  8. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  9. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  10. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  11. at java.lang.reflect.Method.invoke(Method.java:498)
  12. at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
  13. at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:206)
  14. at com.sun.proxy.$Proxy417.post(Unknown Source)
  15. at me.chanjar.weixin.mp.api.impl.WxMpTemplateMsgServiceImpl.sendTemplateMsg(WxMpTemplateMsgServiceImpl.java:35)
  16. at com.tcl.credit.core.service.system.WechatMessagePushServiceImpl.sendMsg(WechatMessagePushServiceImpl.java:73)
  17. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  18. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  19. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  20. at java.lang.reflect.Method.invoke(Method.java:498)
  21. at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
  22. at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:206)
  23. at com.sun.proxy.$Proxy418.sendMsg(Unknown Source)
  24. at com.tcl.credit.biz.service.impl.notice.wechat.WechatBizNoticeServiceImpl.sendCustomerAuditResultWxMsg(WechatBizNoticeServiceImpl.java:73)
  25. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  26. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  27. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  28. at java.lang.reflect.Method.invoke(Method.java:498)
  29. at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
  30. at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
  31. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
  32. at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
  33. at org.apache.skywalking.apm.plugin.spring.async.SWCallable.call(SWCallable.java:47)
  34. at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  35. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  36. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  37. at java.lang.Thread.run(Thread.java:748)
  38. Caused by: javax.net.ssl.SSLHandshakeException: PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
  39. at sun.security.ssl.Alert.createSSLException(Alert.java:131)

发表评论

表情:
评论列表 (有 0 条评论,120人围观)

还没有评论,来说两句吧...

相关阅读