如何解决SSL握手异常/签名与使用Web服务使用者时mule esb中的异常不匹配?

时间:2015-11-06 19:25:13

标签: java ssl mule esb anypoint-studio

我正在尝试使用Web使用者向安全的Web服务(2路ssl)发送请求。这就是我所做的。我使用自签名证书进行测试,使用soap-ui测试2路ssl。

  1. 使用本地引用在Web服务使用者中导入Web服务。

  2. 在引用下添加了https配置与主机,端口

  3. 在TLS / SSL详细信息下,添加了密钥库详细信息,例如两个地方的密钥库位置和密码。

  4. 通过成功提供密钥库信息,使用soap-ui测试了安全服务。

  5. 在soap-ui中使用的同一个密钥库在mule esb中配置

  6. 在运行请求时,我收到以下错误。任何人都可以为我提供解决方案

    配置XML如下

    <ws:consumer-config name="Web_Service_Consumer" wsdlLocation="HelloWorld.wsdl" service="helloworld_client_ep" port="HelloWorld_pt" serviceAddress="https://localhost:8002/soa-infra/services/default/HelloWorld/helloworld_client_ep" doc:name="Web Service Consumer" connectorConfig="HTTP_Request_Configuration"/>
        <data-mapper:config name="String_To_XML" transformationGraphPath="string_to_xml.grf" doc:name="String_To_XML"/>
        <http:request-config name="HTTP_Request_Configuration" protocol="HTTPS" host="localhost" port="8002" doc:name="HTTP Request Configuration" tlsContext-ref="TLS_Context">
        </http:request-config>
        <tls:context name="TLS_Context" doc:name="TLS Context">
            <tls:key-store path="client.jks" password="welcome1" keyPassword="welcome1"/>
        </tls:context>
    
    
    
         Caused by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
         at sun.security.ssl.Alerts.getSSLException(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.SSLEngineImpl.fatal(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.Handshaker.fatalSE(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.Handshaker.fatalSE(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.Handshaker.processLoop(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.Handshaker$1.run(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.Handshaker$1.run(Unknown Source) ~[?:1.7.0_65]
         at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_65]
         at sun.security.ssl.Handshaker$DelegatedTask.run(Unknown Source) ~[?:1.7.0_65]
         at org.glassfish.grizzly.ssl.SSLUtils.executeDelegatedTask(SSLUtils.java:247) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.ssl.SSLBaseFilter.doHandshakeStep(SSLBaseFilter.java:638) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.ssl.SSLFilter.doHandshakeStep(SSLFilter.java:312) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.ssl.SSLBaseFilter.doHandshakeStep(SSLBaseFilter.java:552) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.ssl.SSLBaseFilter.handleRead(SSLBaseFilter.java:273) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$SwitchingSSLFilter.handleRead(GrizzlyAsyncHttpProvider.java:2702) ~[async-http-client-1.8.14.jar:?]
         at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.strategies.SameThreadIOStrategy.executeIoEvent(SameThreadIOStrategy.java:103) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent(AbstractIOStrategy.java:89) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents(SelectorRunner.java:414) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.nio.SelectorRunner.iterateKeys(SelectorRunner.java:383) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:347) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:278) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545) ~[grizzly-framework-2.3.16.jar:2.3.16]
         ... 1 more
     Caused by: sun.security.validator.ValidatorException: Certificate signature validation failed
         at sun.security.validator.SimpleValidator.engineValidate(Unknown Source) ~[?:1.7.0_65]
         at sun.security.validator.Validator.validate(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.Handshaker.processLoop(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.Handshaker$1.run(Unknown Source) ~[?:1.7.0_65]
         at sun.security.ssl.Handshaker$1.run(Unknown Source) ~[?:1.7.0_65]
         at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_65]
         at sun.security.ssl.Handshaker$DelegatedTask.run(Unknown Source) ~[?:1.7.0_65]
         at org.glassfish.grizzly.ssl.SSLUtils.executeDelegatedTask(SSLUtils.java:247) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.ssl.SSLBaseFilter.doHandshakeStep(SSLBaseFilter.java:638) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.ssl.SSLFilter.doHandshakeStep(SSLFilter.java:312) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.ssl.SSLBaseFilter.doHandshakeStep(SSLBaseFilter.java:552) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.ssl.SSLBaseFilter.handleRead(SSLBaseFilter.java:273) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$SwitchingSSLFilter.handleRead(GrizzlyAsyncHttpProvider.java:2702) ~[async-http-client-1.8.14.jar:?]
         at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.strategies.SameThreadIOStrategy.executeIoEvent(SameThreadIOStrategy.java:103) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent(AbstractIOStrategy.java:89) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents(SelectorRunner.java:414) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.nio.SelectorRunner.iterateKeys(SelectorRunner.java:383) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:347) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:278) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565) ~[grizzly-framework-2.3.16.jar:2.3.16]
         at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545) ~[grizzly-framework-2.3.16.jar:2.3.16]
         ... 1 more
     Caused by: java.security.SignatureException: Signature does not match.
         at sun.security.x509.X509CertImpl.verify(Unknown Source) ~[?:1.7.0_65]
         at sun.security.x509.X509CertImpl.verify(Unknown Source) ~[?:1.7.0_65]
         at sun.security.validator.SimpleValidator.engineValidate(Unknown Source) ~[?:1.7.0_65]
     ERROR 2015-11-05 16:00:55,321 [[ACATransmitterService].ACATransmitterServiceFlow.stage1.02] org.mule.exception.CatchMessagingExceptionStrategy: 
     ********************************************************************************
     Message               : Error sending HTTP request. Message payload is of type: byte[]
     Code                  : MULE_ERROR--2
     --------------------------------------------------------------------------------
     Exception stack is:
     1. Signature does not match. (java.security.SignatureException)
       sun.security.x509.X509CertImpl:-1 (null)
     2. Certificate signature validation failed (sun.security.validator.ValidatorException)
       sun.security.validator.SimpleValidator:-1 (null)
     3. General SSLEngine problem (javax.net.ssl.SSLHandshakeException)
       sun.security.ssl.Alerts:-1 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/net/ssl/SSLHandshakeException.html)
     4. General SSLEngine problem (javax.net.ssl.SSLHandshakeException)
       sun.security.ssl.Handshaker:-1 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/net/ssl/SSLHandshakeException.html)
     5. javax.net.ssl.SSLHandshakeException: General SSLEngine problem (java.util.concurrent.ExecutionException)
       org.glassfish.grizzly.impl.SafeFutureImpl$Sync:363 (null)
     6. java.util.concurrent.ExecutionException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem (java.io.IOException)
       org.mule.module.http.internal.request.grizzly.GrizzlyHttpClient:274 (null)
     7. Error sending HTTP request. Message payload is of type: byte[] (org.mule.api.MessagingException)
       org.mule.module.http.internal.request.DefaultHttpRequester:190 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
     --------------------------------------------------------------------------------
     Root Exception stack trace:
     java.security.SignatureException: Signature does not match.
         at sun.security.x509.X509CertImpl.verify(Unknown Source)
         at sun.security.x509.X509CertImpl.verify(Unknown Source)
         at sun.security.validator.SimpleValidator.engineValidate(Unknown Source)
         + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
    

0 个答案:

没有答案