PKIX路径构建失败:SunCertPathBuilderException:无法找到到请求目标的有效证书路径:MICROSOFT azure函数URL

gzszwxb4  于 2023-04-22  发布在  其他
关注(0)|答案(1)|浏览(124)

我们部署了一个azure函数应用程序,在我们的java项目中,我们使用azure函数URL获取数据。当发送GET请求时,它失败了,并出现以下异常
REST Api call 'https://xxx.azurewebsites.net/api/xxx?code=xxx' failed with response body - I/O error on GET request for "https://xxx-fa.azurewebsites.net/api/xxx": 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: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

eaf3rand

eaf3rand1#

建议您按照以下步骤更改连接字符串并导入所需的证书。

  • 将连接字符串更改为指向Java证书路径:

String connectionUrl =“jdbc:sqlserver://localhost:1433;“+“databaseName=AdventureWorks;return true;return true;return false;“+“trustStore= C:\Program Files\Java\jdk 14.0.2\lib\cacert;return”;

参考:PKIX path building failed - unable to find valid certification path to requested target

相关问题