예제 #1
0
  static HttpClient New(
      SSLSocketFactory sf,
      URL url,
      HostnameVerifier hv,
      String proxy,
      int proxyPort,
      boolean useCache)
      throws IOException {
    HttpsClient ret = null;
    if (useCache) {
      /* see if one's already around */
      ret = (HttpsClient) kac.get(url, sf);
      if (ret != null) {
        ret.cachedHttpClient = true;
      }
    }
    if (ret == null) {
      ret = new HttpsClient(sf, url, proxy, proxyPort);
    } else {
      SecurityManager security = System.getSecurityManager();
      if (security != null) {
        security.checkConnect(url.getHost(), url.getPort());
      }
      ret.url = url;
    }
    ret.setHostnameVerifier(hv);

    return ret;
  }
예제 #2
0
 /** See HttpClient for the model for this method. */
 static HttpClient New(SSLSocketFactory sf, URL url, HostnameVerifier hv, boolean useCache)
     throws IOException {
   return HttpsClient.New(sf, url, hv, (String) null, -1, useCache);
 }
예제 #3
0
 /** Get a HTTPS client to the URL. Traffic will be tunneled through the specified proxy server. */
 static HttpClient New(
     SSLSocketFactory sf, URL url, HostnameVerifier hv, String proxy, int proxyPort)
     throws IOException {
   return HttpsClient.New(sf, url, hv, proxy, proxyPort, true);
 }
예제 #4
0
 static HttpClient New(SSLSocketFactory sf, URL url, HostnameVerifier hv) throws IOException {
   return HttpsClient.New(sf, url, hv, true);
 }