Azure:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到到RequestedTarget的有效证书路径

时间:2020-07-09 07:05:19

标签: microsoft-graph-api azure-ad-b2c msal azure-ad-b2b

我们有一个托管在Intranet上的应用程序,我们正在尝试为此配置Azure SSO。登录页面将重定向到Microsoft登录门户,并且我们收到授权码。但是,当我们尝试将请求发回Microsoft以获取令牌时,就会遇到此特定错误。

**sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
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
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:914)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
   at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1283)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1258)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)**

我们通过从浏览器下载证书并将它们导入到jdk / jre / lib / security / cacerts中来放置证书。已启用Web代理访问Internet。我们没有足够的想法来寻求解决方案。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

似乎许多用户对PKIX path building failed: SunCertPathBuilderException: unable to find valid certification path to requested target有类似的问题,这是得分很高的答案:https://stackoverflow.com/a/36427118/1595293

基于:https://magicmonster.com/kb/prg/java/ssl/pkix_path_building_failed/