Package com.sun.enterprise.security.ssl

Examples of com.sun.enterprise.security.ssl.SSLUtils


            };

            // Install the all-trusting trust manager
            SSLContext sc = SSLContext.getInstance(TLS);
            ServiceLocator habitat = Globals.getDefaultHabitat();
            SSLUtils sslUtils = habitat.getService(SSLUtils.class);
            sc.init(sslUtils.getKeyManagers(), trustAllCerts, new java.security.SecureRandom());

            //---------------------------------
            url = new URL(HTTPS_PROTOCOL, _lbHost, Integer.parseInt(_lbPort), contextRoot);
            if (_lbProxyHost != null && _lbProxyPort != null) {
                Proxy proxy = new Proxy(Proxy.Type.HTTP,
View Full Code Here


    {
        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;
    }
View Full Code Here

    public String[] getSupportedCipherSuites()
    {
        try
        {
            final SSLUtils sslUtils = mHabitat.getComponent(SSLUtils.class);
            return sslUtils.getSupportedCipherSuites();
        }
        catch (final Exception ex)
        {
            ImplUtil.getLogger().log( Level.INFO, "Can't get cipher suites", ex);
            return new String[0];
View Full Code Here

            };

            // Install the all-trusting trust manager
            SSLContext sc = SSLContext.getInstance(SSL);
            Habitat habitat = Globals.getDefaultHabitat();
            SSLUtils sslUtils = habitat.getComponent(SSLUtils.class);
            sc.init(sslUtils.getKeyManagers(), trustAllCerts, new java.security.SecureRandom());

            //---------------------------------
            url = new URL(HTTPS_PROTOCOL, _lbHost, Integer.parseInt(_lbPort), contextRoot);
            if (_lbProxyHost != null && _lbProxyPort != null) {
                Proxy proxy = new Proxy(Proxy.Type.HTTP,
View Full Code Here

            };

            // Install the all-trusting trust manager
            SSLContext sc = SSLContext.getInstance(TLS);
            Habitat habitat = Globals.getDefaultHabitat();
            SSLUtils sslUtils = habitat.getComponent(SSLUtils.class);
            sc.init(sslUtils.getKeyManagers(), trustAllCerts, new java.security.SecureRandom());

            //---------------------------------
            url = new URL(HTTPS_PROTOCOL, _lbHost, Integer.parseInt(_lbPort), contextRoot);
            if (_lbProxyHost != null && _lbProxyPort != null) {
                Proxy proxy = new Proxy(Proxy.Type.HTTP,
View Full Code Here

    public String[] getSupportedCipherSuites()
    {
        try
        {
            final SSLUtils sslUtils = mHabitat.getService(SSLUtils.class);
            return sslUtils.getSupportedCipherSuites();
        }
        catch (final Exception ex)
        {
            AMXLoggerInfo.getLogger().log( Level.INFO, AMXLoggerInfo.cantGetCipherSuites, ex);
            return new String[0];
View Full Code Here

    protected static final StringManager sm =
        StringManager.getManager(CustomSocketFactory.class);
    private static final  CustomSocketFactory customSocketFactory = new CustomSocketFactory();

    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, "security.exception", ex);
        }       
    }
View Full Code Here

    protected final SecuritySupport secSup;
    protected final MasterPassword masterPasswordHelper;
   
    protected BaseContainerCallbackHandler() {
        if(Globals.getDefaultHabitat() == null){
            sslUtils = new SSLUtils();
            secSup = SecuritySupport.getDefaultInstance();
            masterPasswordHelper = null;
            sslUtils.postConstruct();
        } else {
            sslUtils = Globals.getDefaultHabitat().getService(SSLUtils.class);
View Full Code Here

                    /* Get the keystore password to see if the user is
                     * authorized to see the list of certificates
                     */
                    String lbl = (localStrings.getLocalString("enterprise.security.keystore",
                            "Enter the KeyStore Password "));
                    SSLUtils sslUtils = Globals.get(SSLUtils.class);
                    System.out.println(lbl
                            + " : (max 3 tries)");
                    int cnt = 0;
                    for (cnt = 0; cnt < 3; cnt++) {
                        // Let the user try putting password thrice
                        System.out.println(lbl + " : ");
      String s = (new BufferedReader(new InputStreamReader(System.in))).readLine();
      if (s != null) {
                            char[] kp = s.toCharArray();
                            if (sslUtils.verifyMasterPassword(kp)) {
                                break;
                            } else {
                                String errmessage = localStrings.getLocalString("enterprise.security.IncorrectKeystorePassword", "Incorrect Keystore Password");
                                System.err.println(errmessage);
                            }
View Full Code Here

    protected final SecuritySupport secSup;
    protected final MasterPassword masterPasswordHelper;
   
    protected BaseContainerCallbackHandler() {
        if(Globals.getDefaultHabitat() == null){
            sslUtils = new SSLUtils();
            secSup = SecuritySupport.getDefaultInstance();
            masterPasswordHelper = null;
            sslUtils.postConstruct();
        } else {
            sslUtils = Globals.getDefaultHabitat().getService(SSLUtils.class);
View Full Code Here

TOP

Related Classes of com.sun.enterprise.security.ssl.SSLUtils

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.