问题描述
请求 Avata API 报错
报错示例
I/O error on POST request for "https://stage.apis.avata.bianjie.ai/v1beta1/account": sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
解决方案
-
检查 JDK 版本,JDK 升级到 1.8 最新的版本试试(如升级到 1.8.0_341 之后);
-
检查证书配置,设置证书;
-
网上提供的相关解决方法(仅供参考,不作为标准解决方法):抓取https网页时,报错sun.security.validator.ValidatorException: PKIX path building failed 解决办法 - 走看看
建议使用 Avata 官方 SDK:https://github.com/bianjieai/avata-sdk-java