Creates a non-authenticating redmine manager.

@param uri    redmine manager URI.
@param httpClient you can provide your own pre-configured HttpClient if you want
to control connection pooling, manage connections eviction, closing, etc.
349536
public static RedmineManager createUnauthenticated(String uri,
                                                HttpClient httpClient) {
        return createWithUserAuth(uri, null, null, httpClient);
    }
1002362
public <T extends Identifiable> void deleteObject(Class<T> classs, String id)
			throws RedmineException {
		final URI uri = getURIConfigurator().getObjectURI(classs, id);
		final HttpDelete http = new HttpDelete(uri);
		send(http);
	}
1044766
public void executePackageManagerMethodHtmlOutputResponse(CloseableHttpClient httpClient, HttpRequestBase method) {
    PackageManagerHtmlMessageCall call = new PackageManagerHtmlMessageCall(httpClient, method, log);
    executeHttpCallWithRetry(call, 0);
  }
1265265
public static SamlEndpoint ofHttpRedirect(URI uri) {
        requireNonNull(uri, "uri");
        return new SamlEndpoint(uri, SamlBindingProtocol.HTTP_REDIRECT);
    }
1102270
protected WebClient instantiateWebClient(URI uri) {
		WebClient webClient = WebClient.create(uri);
		webClient = webClient.accept(MediaType.APPLICATION_JSON);
		webClient = webClient.header(apiAuthHeaderKey, getApitraryApi().getApiKey());
		webClient = webClient.header("Content-Type", contentType);

		HTTPConduit conduit = WebClient.getConfig(webClient).getHttpConduit();
		TLSClientParameters params = conduit.getTlsClientParameters();
		if (params == null) {
			params = new TLSClientParameters();
			conduit.setTlsClientParameters(params);
		}
		params.setDisableCNCheck(true);

		HTTPClientPolicy policy = new HTTPClientPolicy();
		policy.setConnectionTimeout(DEFAULTCONNECTIONTIMEOUT);
		policy.setReceiveTimeout(DEFAULTRECEIVETIMEOUT);
		policy.setAllowChunking(false);
		conduit.setClient(policy);

		return webClient;
	}
691564
public HttpClient setURI(final String uri) throws HibiscusException {

        try {
            setURI(new URI(uri));
        } catch (URISyntaxException e) {
            throw new HibiscusException(e);
        }

        return this;
    }
1144752
def _auth(uri):
    '''
    
    '''

    user, password = _get_credentials()
    if user is False or password is False:
        return False

    basic = _HTTPBasicAuthHandler()
    basic.add_password(realm='Tomcat Manager Application', uri=uri,
                       user=user, passwd=password)
    digest = _HTTPDigestAuthHandler()
    digest.add_password(realm='Tomcat Manager Application', uri=uri,
                        user=user, passwd=password)
    return _build_opener(basic, digest)
453132
public static HttpClientRequest<ByteBuf> createRequest(URI uri) {
        String uriToUse = stripUserInfoFromUriIfDefined(uri).toASCIIString();
        HttpClientRequest<ByteBuf> request = HttpClientRequest.createGet(uriToUse);

        if (uri.getUserInfo() != null) {
            logger.debug("Adding basic authentication header for URI {}", uriToUse);
            String basicAuth = "Basic " + Base64.getEncoder().encodeToString(uri.getUserInfo().getBytes(UTF_8));
            request.withHeader("Authorization", basicAuth);
        }

        return request;
    }
569409
public HttpClientActionBuilder client(HttpClient httpClient) {
		HttpClientActionBuilder clientAction = new HttpClientActionBuilder(action, httpClient)
				.withApplicationContext(applicationContext);
		return clientAction;
	}
1024279
public CloseableHttpClient getHttpClient() {
    try {
      URI crxUri = new URI(props.getPackageManagerUrl());

      final AuthScope authScope = new AuthScope(crxUri.getHost(), crxUri.getPort());
      final Credentials credentials = new UsernamePasswordCredentials(props.getUserId(), props.getPassword());
      final CredentialsProvider credsProvider = new BasicCredentialsProvider();
      credsProvider.setCredentials(authScope, credentials);

      HttpClientBuilder httpClientBuilder = HttpClients.custom()
          .setDefaultCredentialsProvider(credsProvider)
          .addInterceptorFirst(new HttpRequestInterceptor() {
            @Override
            public void process(HttpRequest request, HttpContext context) throws HttpException, IOException {
              // enable preemptive authentication
              AuthState authState = (AuthState)context.getAttribute(HttpClientContext.TARGET_AUTH_STATE);
              authState.update(new BasicScheme(), credentials);
            }
          })
          .setKeepAliveStrategy(new ConnectionKeepAliveStrategy() {
            @Override
            public long getKeepAliveDuration(HttpResponse response, HttpContext context) {
              // keep reusing connections to a minimum - may conflict when instance is restarting and responds in unexpected manner
              return 1;
            }
          });

      // timeout settings
      httpClientBuilder.setDefaultRequestConfig(HttpClientUtil.buildRequestConfig(props));

      // relaxed SSL check
      if (props.isRelaxedSSLCheck()) {
        SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy()).build();
        SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext, new NoopHostnameVerifier());
        httpClientBuilder.setSSLSocketFactory(sslsf);
      }

      // proxy support
      Proxy proxy = getProxyForUrl(props.getPackageManagerUrl());
      if (proxy != null) {
        httpClientBuilder.setProxy(new HttpHost(proxy.getHost(), proxy.getPort(), proxy.getProtocol()));
        if (proxy.useAuthentication()) {
          AuthScope proxyAuthScope = new AuthScope(proxy.getHost(), proxy.getPort());
          Credentials proxyCredentials = new UsernamePasswordCredentials(proxy.getUsername(), proxy.getPassword());
          credsProvider.setCredentials(proxyAuthScope, proxyCredentials);
        }
      }

      return httpClientBuilder.build();
    }
    catch (URISyntaxException ex) {
      throw new PackageManagerException("Invalid url: " + props.getPackageManagerUrl(), ex);
    }
    catch (KeyManagementException | KeyStoreException | NoSuchAlgorithmException ex) {
      throw new PackageManagerException("Could not set relaxedSSLCheck", ex);
    }
  }
390326
public static ClientHttpRequest createWmsRequest(
            final MfClientHttpRequestFactory httpRequestFactory, final URI uri,
            final HttpMethod method) throws IOException {
        switch (method) {
            case GET:
                return httpRequestFactory.createRequest(uri, method);
            case POST:
                final String params = uri.getQuery();
                final URI paramlessUri;
                try {
                    paramlessUri = new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(),
                                           uri.getPort(), uri.getPath(), null, null);
                } catch (URISyntaxException e) {
                    throw new RuntimeException(e);
                }
                final ClientHttpRequest request = httpRequestFactory.createRequest(paramlessUri, method);
                final byte[] encodedParams = params.getBytes(StandardCharsets.UTF_8);
                request.getHeaders().set("Content-Type", "application/x-www-form-urlencoded");
                request.getHeaders().set("Charset", "utf-8");
                request.getHeaders().set("Content-Length", Integer.toString(encodedParams.length));
                request.getBody().write(encodedParams);
                return request;
            default:
                throw new RuntimeException("Unsupported WMS request method: " + method);
        }
    }
1100772
public URI addAPIKey(String uri) {
        try {
            final URIBuilder builder = new URIBuilder(uri);
            if (apiAccessKey != null) {
                builder.setParameter("key", apiAccessKey);
            }
            return builder.build();
        } catch (URISyntaxException e) {
            throw new RedmineInternalError(e);
        }
    }
924582
public static Call create(final BandwidthClient client, final Map <String, Object>params) 
            throws Exception {
    	assert (client != null && params != null);
        final String callUri = client.getUserResourceUri(BandwidthConstants.CALLS_URI_PATH);
    	final RestResponse response = client.post(callUri, params);

        // success here, otherwise an exception is generated
    	final String callId = response.getLocation().substring(client.getPath(callUri).length() + 1);

        return get(client, callId);
    }
1150807
public static CloseableHttpClient initHttpClient(boolean insecureMode, File ocspCacheFile)
  {
    if (httpClient == null)
    {
      synchronized (HttpUtil.class)
      {
        if (httpClient == null)
        {
          httpClient = buildHttpClient(
              insecureMode,
              ocspCacheFile,
              enableOcspResponseCacheServer());
        }
      }
    }
    return httpClient;
  }
865677
function HTTPClient(options) {
  if (!(this instanceof HTTPClient))
    return new HTTPClient(options);

  if (!options)
    options = {};

  if (typeof options === 'string')
    options = { uri: options };

  AsyncObject.call(this);

  this.options = options;
  this.network = Network.get(options.network);

  this.uri = options.uri || `http://localhost:${this.network.rpcPort}`;
  this.socket = null;
  this.apiKey = options.apiKey;
  this.auth = options.auth;
  this.rpc = new RPCClient(options);
}
1033528
private void runEvictor(ConnectionEvictor evictor2) {
		final Thread evictorThread = new Thread(evictor2);
		evictorThread.setDaemon(true);
		evictorThread
				.setName("Redmine communicator connection eviction thread");
		evictorThread.start();
	}
345236
private PoolingHttpClientConnectionManager createConnectionMgr() {
        PoolingHttpClientConnectionManager connectionMgr;

        // prepare SSLContext
        SSLContext sslContext = buildSslContext();
        ConnectionSocketFactory plainsf = PlainConnectionSocketFactory.getSocketFactory();
        // we allow to disable host name verification against CA certificate,
        // notice: in general this is insecure and should be avoided in production,
        // (this type of configuration is useful for development purposes)
        boolean noHostVerification = false;
        LayeredConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
                sslContext,
                noHostVerification ? NoopHostnameVerifier.INSTANCE : new DefaultHostnameVerifier()
        );
        Registry<ConnectionSocketFactory> r = RegistryBuilder.<ConnectionSocketFactory>create()
                .register("http", plainsf)
                .register("https", sslsf)
                .build();
        connectionMgr = new PoolingHttpClientConnectionManager(r, null, null,
                null, connectionPoolTimeToLive, TimeUnit.SECONDS);

        connectionMgr.setMaxTotal(maxConnectionsTotal);
        connectionMgr.setDefaultMaxPerRoute(maxConnectionsPerRoute);
        HttpHost localhost = new HttpHost("localhost", 80);
        connectionMgr.setMaxPerRoute(new HttpRoute(localhost), maxConnectionsPerRoute);
        return connectionMgr;
    }