Tabnine Logo
SSLUtils.getTrustManagers
Code IndexAdd Tabnine to your IDE (free)

How to use
getTrustManagers
method
in
com.sun.enterprise.security.ssl.SSLUtils

Best Java code snippets using com.sun.enterprise.security.ssl.SSLUtils.getTrustManagers (Showing top 12 results out of 315)

origin: org.glassfish.main.security/security

public TrustManager[] getTrustManagers() throws Exception{
  return getTrustManagers(null);
}
public TrustManager[] getTrustManagers(String algorithm) throws IOException,
origin: org.glassfish.security/security

public TrustManager[] getTrustManagers() throws Exception{
  return getTrustManagers(null);
}
public TrustManager[] getTrustManagers(String algorithm) throws IOException,
origin: org.glassfish.main.security/ejb.security

public TrustManager[] getTrustManagers() {
  try {
  return sslUtils.getTrustManagers();
  } catch (Exception e) {
    //TODO: log here
    throw new RuntimeException(e);
  }
}

origin: org.glassfish.security/realms

public  CustomSocketFactory() {
  Habitat habitat = Globals.getDefaultHabitat();
  SSLUtils sslUtils = habitat.getComponent(SSLUtils.class);
  SSLContext sc = null;
  try {
    sc = SSLContext.getInstance(SSL);
    sc.init(sslUtils.getKeyManagers(), sslUtils.getTrustManagers(), new SecureRandom());
  } catch (Exception ex) {
    _logger.log(Level.WARNING, "security.exception", ex);
  }        
  socketFactory = sc.getSocketFactory();
}
 
origin: org.glassfish.main.security/security

public SSLContext getAdminSSLContext(String alias, String protocol) {
  try {
    if (protocol == null) {
      protocol = "TLS";
    }
    SSLContext cntxt = SSLContext.getInstance(protocol);
    KeyManager[] kMgrs = getKeyManagers();
    if (alias != null && alias.length() > 0 && kMgrs != null) {
      for (int i = 0; i < kMgrs.length; i++) {
        kMgrs[i] = new J2EEKeyManager((X509KeyManager)kMgrs[i], alias);
      }
    }
    cntxt.init(kMgrs, getTrustManagers(), null);
    return cntxt;
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
origin: org.glassfish.security/security

public SSLContext getAdminSSLContext(String alias, String protocol) {
  try {
    if (protocol == null) {
      protocol = "TLS";
    }
    SSLContext cntxt = SSLContext.getInstance(protocol);
    KeyManager[] kMgrs = getKeyManagers();
    if (alias != null && alias.length() > 0 && kMgrs != null) {
      for (int i = 0; i < kMgrs.length; i++) {
        kMgrs[i] = new J2EEKeyManager((X509KeyManager)kMgrs[i], alias);
      }
    }
    cntxt.init(kMgrs, getTrustManagers(), null);
    return cntxt;
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
origin: org.glassfish.main.security/security

public  CustomSocketFactory() {
  SSLUtils sslUtils = Globals.getDefaultHabitat().getService(SSLUtils.class);
  SSLContext sc = null;
  try {
    sc = SSLContext.getInstance(SSL);
    sc.init(sslUtils.getKeyManagers(), sslUtils.getTrustManagers(), SharedSecureRandom.get());
    socketFactory = sc.getSocketFactory();
  } catch (Exception ex) {
    _logger.log(Level.WARNING, SecurityLoggerInfo.securityExceptionError, ex);
  }        
}

origin: org.glassfish.security/security

public  CustomSocketFactory() {
  Habitat habitat = Globals.getDefaultHabitat();
  SSLUtils sslUtils = habitat.getComponent(SSLUtils.class);
  SSLContext sc = null;
  try {
    sc = SSLContext.getInstance(SSL);
    sc.init(sslUtils.getKeyManagers(), sslUtils.getTrustManagers(), SharedSecureRandom.get());
  } catch (Exception ex) {
    _logger.log(Level.WARNING, "security.exception", ex);
  }        
  socketFactory = sc.getSocketFactory();
}

origin: org.glassfish.main.security/security

SSLContext getSSLContext(String protocol, String algorithm, String trustAlgorithm) {
  try {
    //V3:Commented to break dependency on WebTier.
    //The SSLSocketFactory CTOR will now take care of setting the kmgr and tmgr
    //SSLSocketFactory.setManagers(getKeyManagers(), getTrustManagers());
    // Creating a default SSLContext and HttpsURLConnection for clients
    // that use Https
    if (protocol == null) {
      protocol = DEFAULT_SSL_PROTOCOL;
    }
    ctx = SSLContext.getInstance(protocol);
    String keyAlias = System.getProperty(HTTPS_OUTBOUND_KEY_ALIAS);
    KeyManager[] kMgrs = getKeyManagers(algorithm);
    if (keyAlias != null && keyAlias.length() > 0 && kMgrs != null) {
      for (int i = 0; i < kMgrs.length; i++) {
        kMgrs[i] = new J2EEKeyManager((X509KeyManager)kMgrs[i], keyAlias);
      }
    }
    ctx.init(kMgrs, getTrustManagers(trustAlgorithm), null);
    HttpsURLConnection.setDefaultSSLSocketFactory(ctx.getSocketFactory());
    //refer issue :http://java.net/jira/browse/GLASSFISH-15369
    SSLContext.setDefault(ctx);
  } catch (Exception e) {
    throw new Error(e);
  }
  return ctx;
}
origin: org.glassfish.security/security

SSLContext getSSLContext(String protocol, String algorithm, String trustAlgorithm) {
  try {
    //V3:Commented to break dependency on WebTier.
    //The SSLSocketFactory CTOR will now take care of setting the kmgr and tmgr
    //SSLSocketFactory.setManagers(getKeyManagers(), getTrustManagers());
    // Creating a default SSLContext and HttpsURLConnection for clients
    // that use Https
    if (protocol == null) {
      protocol = DEFAULT_SSL_PROTOCOL;
    }
    ctx = SSLContext.getInstance(protocol);
    String keyAlias = System.getProperty(HTTPS_OUTBOUND_KEY_ALIAS);
    KeyManager[] kMgrs = getKeyManagers(algorithm);
    if (keyAlias != null && keyAlias.length() > 0 && kMgrs != null) {
      for (int i = 0; i < kMgrs.length; i++) {
        kMgrs[i] = new J2EEKeyManager((X509KeyManager)kMgrs[i], keyAlias);
      }
    }
    ctx.init(kMgrs, getTrustManagers(trustAlgorithm), null);
    HttpsURLConnection.setDefaultSSLSocketFactory(ctx.getSocketFactory());
    //refer issue :http://java.net/jira/browse/GLASSFISH-15369
    SSLContext.setDefault(ctx);
  } catch (Exception e) {
    throw new Error(e);
  }
  return ctx;
}
origin: org.glassfish.main.security/websecurity

   public static synchronized void initStoresAtStartup()
  throws Exception
  {
    if (initialized) {
      return;
    }
    ServiceLocator habitat = Globals.getDefaultHabitat();
    SSLUtils sslUtils = habitat.getService(SSLUtils.class);

    keyManagers = sslUtils.getKeyManagers();
    trustManagers = sslUtils.getTrustManagers();
  
    // Creating a default SSLContext and HttpsURLConnection for clients 
    // that use Https
    SSLContext ctx = SSLContext.getInstance("TLS");
    String keyAlias = System.getProperty(SSLUtils.HTTPS_OUTBOUND_KEY_ALIAS);
    KeyManager[] kMgrs = sslUtils.getKeyManagers();
    if (keyAlias != null && keyAlias.length() > 0 && kMgrs != null) {
      for (int i = 0; i < kMgrs.length; i++) {
        kMgrs[i] = new J2EEKeyManager((X509KeyManager)kMgrs[i], keyAlias);
      }
    }
  ctx.init(kMgrs, sslUtils.getTrustManagers(), null);
    HttpsURLConnection.setDefaultSSLSocketFactory(ctx.getSocketFactory());
    initialized = true;
  }
}
origin: org.glassfish.security/securitycommon

ctx.init(kMgrs, getTrustManagers(), null);
com.sun.enterprise.security.sslSSLUtilsgetTrustManagers

Popular methods of SSLUtils

  • getKeyManagers
  • <init>
  • checkPermission
  • getKeyStores
  • getSupportedCipherSuites
  • getTrustStores
  • mergingTrustStores
  • postConstruct
  • setAppclientSsl
  • getAdminSSLContext
  • getAdminSocketFactory
  • getKeyStore
  • getAdminSocketFactory,
  • getKeyStore,
  • getMergedTrustStore,
  • getPrivateKeyEntryFromTokenAlias,
  • getSSLContext,
  • getTrustStore,
  • verifyMasterPassword,
  • checkCertificateDates,
  • getKeyStorePass

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now