public static SSLContext createSSLContext(TrustManager trustManager,KeyManager keyManager){
  try {
    SSLContext ctx=SSLContext.getInstance("TLS");
    ctx.init(new KeyManager[]{keyManager},new TrustManager[]{trustManager},null);
    return ctx;
  }
 catch (  NoSuchAlgorithmException|KeyManagementException e) {
    throw new RuntimeException("Failed to create SSLContext",e);
  }
}

public static SSLContext createSSLContext ( TrustManager trustManager , KeyManager keyManager ) { try { SSLContext ctx = SSLContext . getInstance ( "TLS" ) ; ctx . init ( new KeyManager [ ] { keyManager } , new TrustManager [ ] { trustManager } , null ) ; return ctx ; } catch ( NoSuchAlgorithmException | KeyManagementException e ) { throw new RuntimeException ( "Failed to create SSLContext" , e ) ; } }
create an sslcontext for the given trustmanager and keymanager
