企业微信发消息报错 javax.net.ssl.SSLHandshakeException
企业微信发消息报错误信息如下:
2019-09-12 21:39:46 jxstar: qytoken url: https://qyapi.weixin.qq.com/cg ... 3Dxxx
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderExce
ption: unable to find valid certification path to requested target
需要在jdk路径下加载ssl证书,导入证书步骤:
在浏览器路径地址旁可以导出证书。
然后在cmd命令窗口执行命令:
keytool -import -file c:\qy_weixin_qq_com.crt -keystore "%JAVA_HOME%\jre\lib\security\cacerts" -alias qy_weixin
然后重启tomcat,发送消息执行成功。
--更多命令说明
--删除证书
keytool -delete -alias qy_weixin -keystore "%JAVA_HOME%\jre\lib\security\cacerts"
--查看证书
keytool -list -keystore "%JAVA_HOME%\jre\lib\security\cacerts" -storepass changeit
附件中有截图说明与证书文件,有效期是:2020年9月10日。
2019-09-12 21:39:46 jxstar: qytoken url: https://qyapi.weixin.qq.com/cg ... 3Dxxx
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderExce
ption: unable to find valid certification path to requested target
需要在jdk路径下加载ssl证书,导入证书步骤:
在浏览器路径地址旁可以导出证书。
然后在cmd命令窗口执行命令:
keytool -import -file c:\qy_weixin_qq_com.crt -keystore "%JAVA_HOME%\jre\lib\security\cacerts" -alias qy_weixin
然后重启tomcat,发送消息执行成功。
--更多命令说明
--删除证书
keytool -delete -alias qy_weixin -keystore "%JAVA_HOME%\jre\lib\security\cacerts"
--查看证书
keytool -list -keystore "%JAVA_HOME%\jre\lib\security\cacerts" -storepass changeit
附件中有截图说明与证书文件,有效期是:2020年9月10日。