title: WebSphere + Simple HTTPS Post = SocketException
body: <p>This is about as basic as I can make it - brand new setup in RAD, brand new project, all default settings and this code:</p>
  
  <pre><code>        try {
          String url = "https://www.verisign.com";
          HttpClient client = new HttpClient();
          PostMethod post = new PostMethod(url);
          client.executeMethod(post);
          String response2 = post.getResponseBodyAsString();
  
      } catch (Exception e) {
          e.printStackTrace();
  
      }
  </code></pre>
  
  <p>This is the error I get (not very informative imho)</p>
  
  <pre><code>    java.net.SocketException
  at javax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java:5)
  at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:93)
  at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:651)
  at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:628)
  at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:497)
  </code></pre>
  
  <p>Any ideas on what I could try to get a more descriptive error?</p>
  
  <p><em>UPDATE</em></p>
  
  <p>When I look in "runtimes\base_v61\profiles\AppSrv01\logs\ffdc" I find this error getting printed to the logs:</p>
  
  <pre><code>com.ibm.websphere.ssl.SSLException: java.io.IOException: DerInputStream.getLength(): lengthTag=127, too big.
  at com.ibm.websphere.ssl.JSSEHelper.getSSLSocketFactory(JSSEHelper.java:583)
  at com.ibm.websphere.ssl.protocol.SSLSocketFactory.&lt;init&gt;(SSLSocketFactory.java:87)
  at java.lang.Class.newInstanceImpl(Native Method)
  at java.lang.Class.newInstance(Class.java:1243)
  at javax.net.ssl.SSLSocketFactory.getDefault(SSLSocketFactory.java:9)
  at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:93)
  at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:651)
  at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:628)
  at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:497)
  </code></pre>
  
  <p><em>UPDATE - With the answer</em>
  FIXED, that was a fun issue, here's how you resolve it (if you ever come across it)</p>
  
  <p>Step 1: Launch ikeyman.exe in \SDP70\jdk\jre\bin</p>
  
  <p>Step 2: Open your certs file in SDP70\runtimes\base_v61\java\jre\lib\security (for example, mine is cacerts)</p>
  
  <p>Step 3: Enter in your password (do you remember your password)? </p>
  
  <p>Step 4: IF THE DATABASE TYPE IS NOT PKS12 CONTINUE</p>
  
  <p>Step 5: Save your cert file as pks12</p>
  
  <p>Step 6: Stop Websphere </p>
  
  <p>Step 7: Rename your old cert file to something like "cacerts.bak" rename your new PKS12 certs file to be the default</p>
  
  <p>Step 8: Restart websphere, get legitimate error</p>
  
  <p>Step 9: Profit</p>