title: Getting "Caused by: WebServiceIOException I/O error: Unexpected end of file from server", although using same cert works with SOAP UI
body: <p>I have defined the template as </p>
  
  <pre><code>&lt;bean id="template" class="org.springframework.ws.client.core.WebServiceTemplate"&gt;
      &lt;property name="messageSender"&gt;
          &lt;bean class="org.springframework.ws.transport.http.HttpsUrlConnectionMessageSender"&gt;
              &lt;property name="trustManagers"&gt;
                  &lt;bean class="org.springframework.ws.soap.security.support.TrustManagersFactoryBean"&gt;
                      &lt;property name="keyStore" ref="myTrustStore" /&gt;
                  &lt;/bean&gt;
              &lt;/property&gt;
              &lt;property name="keyManagers"&gt;
                  &lt;bean class="org.springframework.ws.soap.security.support.KeyManagersFactoryBean"&gt;
                      &lt;property name="keyStore" ref="myKeyStore" /&gt;
                      &lt;property name="password" value="${cdds.webservice.keystore_password}" /&gt;
                  &lt;/bean&gt;
              &lt;/property&gt;
          &lt;/bean&gt;
      &lt;/property&gt;
  </code></pre>
  
  <p></p>
  
  <p>It works fine with X certificate, but as soon as I use Y certificate it throws the below error</p>
  
  <blockquote>
    <p>Caused by: org.springframework.ws.client.WebServiceIOException: I/O error: Unexpected end of file from server; nested exception is java.net.SocketException: Unexpected end of file from server
    at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:561)
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:390)
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:383)
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:373)</p>
  </blockquote>
  
  <p>Root Cause exception</p>
  
  <blockquote>
    <p>Caused by: java.net.SocketException: Unexpected end of file from server
    <br/>at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:772)
    <br/>at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
    <br/>at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:769)
    <br/>at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
    <br/>at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1323)
    <br/>at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
    <br/>at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
    <br/>at org.springframework.ws.transport.http.HttpUrlConnection.getResponseCode(HttpUrlConnection.java:143)
    <br/>at org.springframework.ws.transport.http.AbstractHttpSenderConnection.hasError(AbstractHttpSenderConnection.java:46)
    <br/>at org.springframework.ws.client.core.WebServiceTempl<br/>ate.hasError(WebServiceTempl<br/>ate.java:673)
    <br/>at org.springframework.ws.client.core.WebServiceTempl<br/>ate.doSendAndReceive(WebServiceTempl<br/>ate.java:607)
    <br/>at org.springframework.ws.client.core.WebServiceTempl<br/>ate.sendAndReceive(WebServiceTempl<br/>ate.java:555)> </p>
  </blockquote>
  
  <p>However when I am calling the same webservice via SOAP UI by setting the keystore (Y certificate) and password, it is working fine.</p>
  
  <p>Not able to understand, why the code is throwing "unexpected end of file from server" for Y certificate, where as it is working via SOAP UI</p>