public static SSLContext initSslContext(SSLContext sslContext,KeyStore trustStore,TrustManagerFactory trustManagerFactory) throws GeneralSecurityException {
  trustManagerFactory.init(trustStore);
  sslContext.init(null,trustManagerFactory.getTrustManagers(),null);
  return sslContext;
}

public static SSLContext initSslContext ( SSLContext sslContext , KeyStore trustStore , TrustManagerFactory trustManagerFactory ) throws GeneralSecurityException { trustManagerFactory . init ( trustStore ) ; sslContext . init ( null , trustManagerFactory . getTrustManagers ( ) , null ) ; return sslContext ; }
initializes the ssl context to the trust managers supplied by the trust manager factory for the given trust store .
