예제 #1
0
  private static void permissionCheck() {
    SecurityManager sec = System.getSecurityManager();

    if (sec != null) {
      sec.checkPermission(new RuntimePermission("useKeychainStore"));
    }
  }
예제 #2
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;
  }
예제 #3
0
 private static EquinoxSecurityManager getSupportedSystemSecurityManager() {
   try {
     EquinoxSecurityManager equinoxManager = (EquinoxSecurityManager) System.getSecurityManager();
     return equinoxManager != null && equinoxManager.inCheckPermission() ? equinoxManager : null;
   } catch (ClassCastException e) {
     return null;
   }
 }
예제 #4
0
 private static void checkAllPermission() {
   SecurityManager sm = System.getSecurityManager();
   if (sm != null) sm.checkPermission(new AllPermission());
 }