/** * Returns context with AuthCache or null in case of any exception was thrown. * Use "http" schema. * * @param host * @param port * @param user * @param password * @return {@link org.apache.http.client.protocol.HttpClientContext HttpClientContext} */ public static HttpClientContext createPreemptiveBasicAuthentication( String host, int port, String user, String password ) { return createPreemptiveBasicAuthentication( host, port, user, password, "http" ); }