title: How to solve SSL Handshake exception/signature does not match exception in mule esb when using web service consumer?
body: <p>I am trying to send request to a secure web service(2 way ssl) using web consumer. Here is what I have done. I have used self signed certificates for testing purpose which 2 way ssl is tested with soap-ui.</p>
  
  <ol>
  <li><p>imported web service in web service consumer using local references.</p></li>
  <li><p>Under references added https configuration with host, port</p></li>
  <li><p>Under TLS/SSL details added keystore details like location of keystore and password in both the places.</p></li>
  <li><p>Tested the secure service with soap-ui by providing keystore information successfully.</p></li>
  <li><p>The same keystore which is used in soap-ui is configured in mule esb</p></li>
  </ol>
  
  <p>while running the request I am getting the following error.  Can any one provide me solution</p>
  
  <p>configuration XML as below</p>
  
  <pre><code>&lt;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"/&gt;
      &lt;data-mapper:config name="String_To_XML" transformationGraphPath="string_to_xml.grf" doc:name="String_To_XML"/&gt;
      &lt;http:request-config name="HTTP_Request_Configuration" protocol="HTTPS" host="localhost" port="8002" doc:name="HTTP Request Configuration" tlsContext-ref="TLS_Context"&gt;
      &lt;/http:request-config&gt;
      &lt;tls:context name="TLS_Context" doc:name="TLS Context"&gt;
          &lt;tls:key-store path="client.jks" password="welcome1" keyPassword="welcome1"/&gt;
      &lt;/tls:context&gt;
  
  
  
       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)
  </code></pre>