当前位置: 首页 > 知识库问答 >
问题:

通过SSL调用Mule SOAP会导致“无法找到到请求目标的有效认证路径”

岳玉堂
2023-03-14
<https:connector name="httpsConnector" doc:name="HTTP-HTTPS">
    <https:tls-key-store path="keystore.jks" keyPassword="****" storePassword="****"/>
</https:connector>
<ws:consumer-config name="Web_Service_Consumer" wsdlLocation="https://sm1.actions.aclu.org:7443/sm/services/mailing/v2?wsdl" service="MailingService" port="MailingServicePort" serviceAddress="https://sm1.actions.aclu.org:7443/sm/services/mailing/v2"  doc:name="Web Service Consumer" connector-ref="httpsConnector">
    <ws:security>
        <ws:wss-username-token username="muleapi" password="k%t5mSZRgWsAjGwq" passwordType="TEXT" addCreated="true" addNonce="true"/>
    </ws:security>
</ws:consumer-config>
<flow name="soaptestFlow">
    <poll doc:name="Poll">
        <ws:consumer config-ref="Web_Service_Consumer" operation="list" doc:name="Web Service Consumer" />
    </poll>
    <mulexml:xml-to-object-transformer mimeType="application/java" doc:name="XML to Obj"/>
    <logger message="extracted data: #[payload]" level="INFO" doc:name="Logger"/>
</flow>

我收到的错误是:

Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source) ~[?:1.7.0_80]
    at java.security.cert.CertPathBuilder.build(Unknown Source) ~[?:1.7.0_80]
    at sun.security.validator.PKIXValidator.doBuild(Unknown Source) ~[?:1.7.0_80]
    at sun.security.validator.PKIXValidator.engineValidate(Unknown Source) ~[?:1.7.0_80]
    at sun.security.validator.Validator.validate(Unknown Source) ~[?:1.7.0_80]
    at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source) ~[?:1.7.0_80]
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source) ~[?:1.7.0_80]
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source) ~[?:1.7.0_80]
    at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source) ~[?:1.7.0_80]
    at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source) ~[?:1.7.0_80]
    at sun.security.ssl.Handshaker.processLoop(Unknown Source) ~[?:1.7.0_80]
    at sun.security.ssl.Handshaker.process_record(Unknown Source) ~[?:1.7.0_80]
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source) ~[?:1.7.0_80]
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source) ~[?:1.7.0_80]
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) ~[?:1.7.0_80]
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) ~[?:1.7.0_80]
    at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source) ~[?:1.7.0_80]
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source) ~[?:1.7.0_80]
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) ~[?:1.7.0_80]
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source) ~[?:1.7.0_80]
    at java.net.URL.openStream(Unknown Source) ~[?:1.7.0_80]
    at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(StringUtils.java:158) ~[wsdl4j-1.6.3.jar:1.6.3]
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2270) ~[wsdl4j-1.6.3.jar:1.6.3]
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2239) ~[wsdl4j-1.6.3.jar:1.6.3]
    at org.mule.module.ws.consumer.WSConsumer.parseWsdl(WSConsumer.java:356) ~[mule-module-ws-3.7.2.jar:3.7.2]
    at org.mule.module.ws.consumer.WSConsumer.initialise(WSConsumer.java:91) ~[mule-module-ws-3.7.2.jar:3.7.2]
    at org.mule.endpoint.DefaultInboundEndpoint.createMessageProcessorChain(DefaultInboundEndpoint.java:172) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.endpoint.AbstractEndpoint.getMessageProcessorChain(AbstractEndpoint.java:521) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.endpoint.DefaultInboundEndpoint.start(DefaultInboundEndpoint.java:100) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.construct.AbstractFlowConstruct.startIfStartable(AbstractFlowConstruct.java:325) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.construct.AbstractPipeline.doStart(AbstractPipeline.java:353) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.construct.Flow.doStart(Flow.java:90) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.construct.AbstractFlowConstruct$2.onTransition(AbstractFlowConstruct.java:136) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.construct.AbstractFlowConstruct$2.onTransition(AbstractFlowConstruct.java:132) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.lifecycle.AbstractLifecycleManager.invokePhase(AbstractLifecycleManager.java:138) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.construct.FlowConstructLifecycleManager.fireStartPhase(FlowConstructLifecycleManager.java:92) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.construct.AbstractFlowConstruct.start(AbstractFlowConstruct.java:131) ~[mule-core-3.7.2.jar:3.7.2]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_80]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_80]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_80]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_80]
    at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:237) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.lifecycle.RegistryLifecycleCallback.doApplyLifecycle(RegistryLifecycleCallback.java:91) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.lifecycle.RegistryLifecycleCallback.onTransition(RegistryLifecycleCallback.java:67) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.lifecycle.RegistryLifecycleManager.invokePhase(RegistryLifecycleManager.java:140) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.lifecycle.RegistryLifecycleManager.fireLifecycle(RegistryLifecycleManager.java:111) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.registry.AbstractRegistryBroker.fireLifecycle(AbstractRegistryBroker.java:88) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.registry.MuleRegistryHelper.fireLifecycle(MuleRegistryHelper.java:141) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:91) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:87) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.lifecycle.MuleContextLifecycleManager.invokePhase(MuleContextLifecycleManager.java:69) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.lifecycle.MuleContextLifecycleManager.fireLifecycle(MuleContextLifecycleManager.java:61) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:294) ~[mule-core-3.7.2.jar:3.7.2]
    at org.mule.module.launcher.application.DefaultMuleApplication.start(DefaultMuleApplication.java:134) ~[mule-module-launcher-3.7.2.jar:3.7.2]

共有1个答案

习高格
2023-03-14

如果您的应用程序是使用者,则不需要定义密钥存储,而是定义信任存储或在JRE cacert中添加服务器证书,这是默认的信任存储。

您可以在以下帖子中获得一些帮助:无法找到到请求目标的有效证书路径-即使在导入证书后也出现错误

cacerts和keystore有什么区别

 类似资料:
  • 密钥存储库已经生成并放置在项目的资源目录中。我还为我试图到达的服务器导入了证书。

  • 我最近为我的maven repo(Apache代理背后的人工制品)切换到了letsencrypt证书。通过浏览器访问回购协议工作正常,证书没有问题(下面的屏幕截图)。 如果我手动将证书导入到java密钥库中,它也可以工作。 但是根据这个SO问题,Java应该接受以8u101开头的lets加密证书。 我总是遇到这样的例外:

  • 我正在使用restTemplate发出post请求,并收到以下错误:无法找到到请求目标的有效证书路径 我的方法如下:

  • 问题内容: 我有一个可以从https服务器下载文件的类。当我运行它时,它返回很多错误。我的证书似乎有问题。是否可以忽略客户端服务器认证?如果是这样,怎么办? 错误: 问题答案: 当你的服务器具有自签名证书时,会出现此问题。要解决此问题,你可以将此证书添加到JVM的受信任证书列表中。 在本文中,作者描述了如何从浏览器中获取证书并将其添加到JVM的cacerts文件中。你可以使用-参数编辑文件或运行应

  • 我试图访问我的应用程序中的网址,但我得到了这个错误。 我尝试应用所有这些修复,但没有成功:http://www.mkyong.com/webservices/jax-ws/suncertpathbuilderexception-unable-to-find-valid-certification-path-to-requested-target/ 很快,它需要运行InstallCert应用程序(j

  • 我在Flutter中创建了一个新应用程序。我尝试在Android Mobile上运行该应用程序。它显示在错误下方。 但当我试图在Chrome或Edge(网络设备)上运行同样的程序时。它在跑。