title: Replace SSLContext default with own implementation and trust manger
body: <p>Based on this answer from Jcs (<a href="https://stackoverflow.com/questions/4868654/httpunit-webconversation-ssl-issues">HttpUnit WebConversation SSL Issues</a>) I tried to replace the <code>SSLContext.getDefault()</code> with my own trust manager.</p>
  
  <pre><code>SSLContext ssl = SSLContext.getDefault();
  ssl.init(null, new X509TrustManager[]{new AnyTrustManager()}, null);
  ssl.setDefault(ssl);
  </code></pre>
  
  <p>AnyTrustManager():</p>
  
  <pre><code>import java.security.cert.X509Certificate;
  import javax.net.ssl.X509TrustManager;
  
  public class AnyTrustManager implements X509TrustManager
  {
    X509Certificate[] client = null;
    X509Certificate[] server = null;
  
    public void checkClientTrusted(X509Certificate[] chain, String authType)
    {
      client = chain;
    }
  
    public void checkServerTrusted(X509Certificate[] chain, String authType)
    {
      server = chain;
    }
  
    public X509Certificate[] getAcceptedIssuers()
    {
      return new X509Certificate[0];
    }
  }
  </code></pre>
  
  <p>I need to do this because a 3rd party .jar is only using the SSLContext default which causes me some issues so for the duration of this action I have to change the default to something else and change it back later.</p>
  
  <p>This will unfortunately throw a  <code>java.security.KeyManagementException: Default SSLContext is initialized automatically</code> exception. </p>
  
  <p>How can I get this to work on Java 8?</p>