public static final SSLContext createSSLContext(final String protocol,final String provider,final KeyManager[] keyManagers,final TrustManager[] trustManagers){
  try {
    SSLContext context=SSLContext.getInstance(protocol,provider);
    context.init(keyManagers,trustManagers,new SecureRandom());
    return context;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

public static final SSLContext createSSLContext ( final String protocol , final String provider , final KeyManager [ ] keyManagers , final TrustManager [ ] trustManagers ) { try { SSLContext context = SSLContext . getInstance ( protocol , provider ) ; context . init ( keyManagers , trustManagers , new SecureRandom ( ) ) ; return context ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
create a sslcontext with a keymanager using the private key and certificate chain from the given keystore and a trustmanager using the certificates authorities from the same keystore .
