程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了“无法找到请求目标的有效认证路径”,但浏览器表示可以大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决“无法找到请求目标的有效认证路径”,但浏览器表示可以?

开发过程中遇到“无法找到请求目标的有效认证路径”,但浏览器表示可以的问题如何解决?下面主要结合日常开发的经验,给出你关于“无法找到请求目标的有效认证路径”,但浏览器表示可以的解决方法建议,希望对你解决“无法找到请求目标的有效认证路径”,但浏览器表示可以有所启发或帮助;

可以在以下密钥库中找到不同的证书:

%JAVA_HOME%/ jre / lib / security / cacerts

如果要列出受信任的证书:

keytool -List -keystore %JAVA_HOME%/jre/lib/security/cacerts

密码是可选列出的。

如果要添加条目:

首先,导出要导入的证书,假设它是c:\ cert.crt。最好的方法是使用firefox,右键单击URL中的锁定图片,然后单击几下,便具有导出功能。

然后输入:

keytool -import -alias my-cert -file c:\cert.crt -keystore %JAVA_HOME%/jre/lib/security/cacerts

密码是:changeit

别名是用户定义的标签,请明智地选择它,以记住是否有一天需要它。

有了这些,您应该能够信任证书并使所有内容重新运行。

解决方法

我正在开发一个Java应用程序,该应用程序连接到https://ut.eurodw.eu/(欧洲数据仓库的测试环境)中公开的SOAP服务。我正在使用最近重新格式化为Windows
8.1的开发计算机上工作。今天,我尝试通过我的程序通过SOAP向他们发送创建请求,并收到以下错误消息

Caused by: javax.xml.ws.WebserviceException: Could not send message.
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146)
    at com.sun.proxy.$Proxy110.createDeal(Unknown sourcE)
    at it.csttech.edwin.services.spring.EdwinserviceImpl.createDeal(EdwinserviceImpl.java:102)
    at it.csttech.edwin.consumercredit.data.managers.spring.DealManagerImpl.createEdCode(DealManagerImpl.java:319)
    ... 77 more
Caused by: javax.net.ssl.SSLHandshakeException: SSLHandshakeException invoking https://ut.eurodw.eu/edservices/2.2/Dealservice.svc: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.reflect.NativeConstructOraccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructOraccessorImpl.newInstance(NativeConstructOraccessorImpl.java:57)
    at sun.reflect.DelegaTingConstructOraccessorImpl.newInstance(DelegaTingConstructOraccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.apache.cxf.transport.http.httpConduit$WrappedOutputStream.mapException(httpConduit.java:1339)
    at org.apache.cxf.transport.http.httpConduit$WrappedOutputStream.close(httpConduit.java:1323)
    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
    at org.apache.cxf.transport.http.httpConduit.close(httpConduit.java:628)
    at org.apache.cxf.interceptor.messageSenderInterceptor$messageSenderEndingInterceptor.handlemessage(messageSenderInterceptor.java:62)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:565)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:474)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:377)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:330)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
    ... 80 more
Caused by: 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:1884)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:276)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:270)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1341)
    at sun.security.ssl.ClientHandshaker.processmessage(ClientHandshaker.java:153)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:804)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)
    at sun.net.www.protocol.https.httpsClient.afterConnect(httpsClient.java:563)
    at sun.net.www.protocol.https.AbstractDelegatehttpsURLConnection.connect(AbstractDelegatehttpsURLConnection.java:185)
    at sun.net.www.protocol.http.httpURLConnection.getOutputStream(httpURLConnection.java:1091)
    at sun.net.www.protocol.https.httpsURLConnectionImpl.getOutputStream(httpsURLConnectionImpl.java:250)
    at org.apache.cxf.transport.http.URLConnectionhttpConduit$URLConnectionWrappedOutputStream.setupWrappedStream(URLConnectionhttpConduit.java:174)
    at org.apache.cxf.transport.http.httpConduit$WrappedOutputStream.handleHeadersTrustCaching(httpConduit.java:1283)
    at org.apache.cxf.transport.http.httpConduit$WrappedOutputStream.onFirstWrite(httpConduit.java:1239)
    at org.apache.cxf.transport.http.URLConnectionhttpConduit$URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionhttpConduit.java:201)
    at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47)
    at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)
    at org.apache.cxf.transport.http.httpConduit$WrappedOutputStream.close(httpConduit.java:1296)
    ... 90 more
Caused by: 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.validator.PKIXValidator.doBuild(PKIXValidator.java:385)
    at sun.security.validator.PKIXValidator.ENGIneValidate(PKIXValidator.java:292)
    at sun.security.validator.Validator.validate(Validator.java:260)
    at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:326)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:126)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1323)
    ... 108 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.ENGIneBuild(SunCertPathBuilder.java:196)
    at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268)
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380)
    ... 114 more

正如您通过单击我的上面的链接所看到的,这不是自签名证书,而是由GoDaddy公共CA发布的,并由我的Firefox浏览器识别。我的Java版本是1.7.0_60-b19。修改代码以允许不安全的SSL连接将是一个
坏主意

相反,我想确保eurodw的证书在信任库中。我该如何检查?以及如何导入新证书?

PS:我目前无法在部署最终应用程序的服务器上进行测试:我只能使用自己的tomcat安装。

大佬总结

以上是大佬教程为你收集整理的“无法找到请求目标的有效认证路径”,但浏览器表示可以全部内容,希望文章能够帮你解决“无法找到请求目标的有效认证路径”,但浏览器表示可以所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。