微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

从其他应用程序调用 WSO2 API 显示错误“sun.security.validator.ValidatorException:PKIX 路径构建失败”

如何解决从其他应用程序调用 WSO2 API 显示错误“sun.security.validator.ValidatorException:PKIX 路径构建失败”

我正在尝试调用 WSO2 API 以在 WSO2 身份服务器中创建新用户。 WSO2 API 如下: 使用 Java 调用服务时,出现如下错误

curl -v -k --user admin:admin --data "{"schemas":[],"name": { "familyName":"family_name","givenname":"given_name"},"userName":"user_name","password":"pass_word","emails":[{"primary":true,"value":"im@example.net","type":"work"},{"primary":false,"value":"im2@gmail.com","type":"home"} ] }" --header "ContentType:application/json" https://localhost:9443/wso2/scim/Users

错误信息是:

引起:javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:PKIX 路径构建失败: sun.security.provider.certpath.SunCertPathBuilderException:无法 找到请求目标的有效认证路径 sun.security.ssl.Alerts.getSSLException(Alerts.java:192) 在 sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1946) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:316) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:310) 在 sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1640) 在 sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:223) 在 sun.security.ssl.Handshaker.processLoop(Handshaker.java:1037) 在 sun.security.ssl.Handshaker.process_record(Handshaker.java:965) 在 sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1064) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367) 在 sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395) 在 sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379) 在 org.apache.http.conn.ssl.SSLConnectionSocketFactory.createlayeredSocket(SSLConnectionSocketFactory.java:436) 在 org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384) 在 org.apache.http.impl.conn.DefaultHttpClientConnectionoperator.connect(DefaultHttpClientConnectionoperator.java:142) 在 org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376) 在 org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393) 在 org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) 在 org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) 在 org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) 在 org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) 在 org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) 在 org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) 在 org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) 在 org.jboss.resteasy.client.jaxrs.engines.ManualClosingApacheHttpClient43Engine.invoke(ManualClosingApacheHttpClient43Engine.java:268)


我创建了一个密钥库文件(client.keystore)并复制到 src/main/resources/meta-inf/resources/ 文件夹中,但问题仍然存在。 如果有人遇到此问题,请提出解决此问题的方法

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。