Package com.sun.enterprise.config.serverbeans

Examples of com.sun.enterprise.config.serverbeans.Ssl


                IiopService iiopBean = ServerBeansFactory.getIiopServiceBean(configContext);

                IiopListener[] iiopListeners = iiopBean.getIiopListener();
                int listenersLength = (iiopListeners != null) ? iiopListeners.length : 0;
                for (int i = 0; i < listenersLength; i++) {
                    Ssl ssl = iiopListeners[i].getSsl();
                    SSLInfo sslInfo = null;
                    if (iiopListeners[i].isSecurityEnabled()) {
                        if (ssl != null) {
                            sslInfo = init(ssl.getCertNickname(),
                                ssl.isSsl2Enabled(), ssl.getSsl2Ciphers(),
                                ssl.isSsl3Enabled(), ssl.getSsl3TlsCiphers(),
                                ssl.isTlsEnabled());
                        } else {
                            sslInfo = getDefaultSslInfo();
                        }
                        portToSSLInfo.put(
                            new Integer(iiopListeners[i].getPort()), sslInfo);
                    }
                }

                if (iiopBean.getSslClientConfig() != null &&
                        iiopBean.getSslClientConfig().isEnabled()) {
                    Ssl outboundSsl = iiopBean.getSslClientConfig().getSsl();
                    if (outboundSsl != null) {
                        clientSslInfo = init(outboundSsl.getCertNickname(),
                            outboundSsl.isSsl2Enabled(),
                            outboundSsl.getSsl2Ciphers(),
                            outboundSsl.isSsl3Enabled(),
                            outboundSsl.getSsl3TlsCiphers(),
                            outboundSsl.isTlsEnabled());
                    }
                }
                if (clientSslInfo == null) {
                    clientSslInfo = getDefaultSslInfo();
                }
View Full Code Here


                        checkForAddrAny(props, iiopListenerBeans[i].getAddress());
                        listenSockets.append((listenSockets.length()>0 ? "," : "")
                                + IIOP_CLEAR_TEXT_CONNECTION
                                + ":" + iiopListenerBeans[i].getPort());
                    } else {
                        Ssl sslBean =  null;
                        sslBean = iiopListenerBeans[i].getSsl();
                        assert sslBean != null;

                        // parse clientAuth
                        String type;
                        boolean clientAuth = sslBean.isClientAuthEnabled();
                        if (clientAuth)
                            type = SSL_MUTUALAUTH;
                        else
                            type = SSL;
     
View Full Code Here

    private static void checkServerSSLOutboundSettings(Properties props) {
        if (iiopServiceBean != null) {
            SslClientConfig sslClientConfigBean = iiopServiceBean.getSslClientConfig();
            if (sslClientConfigBean != null) {
                Ssl ssl = sslClientConfigBean.getSsl();
                assert(ssl != null);
            }
        }
    }
View Full Code Here

        {
            if(listener==null)
                throw e;
        }
       
        Ssl ssl = new Ssl();
        //strings
        if(certNickname!=null)
            ssl.setCertNickname(certNickname);
        if(ssl2Ciphers!=null)
            ssl.setSsl2Ciphers(ssl2Ciphers);
        if(ssl3TlsCiphers!=null)
            ssl.setSsl3TlsCiphers(ssl3TlsCiphers);
        //Booleans
        if(ssl2Enabled!=null)
            ssl.setSsl2Enabled(ssl2Enabled.booleanValue());
        if(ssl3Enabled!=null)
            ssl.setSsl3Enabled(ssl3Enabled.booleanValue());
        if(tlsEnabled!=null)
            ssl.setTlsEnabled(tlsEnabled.booleanValue());
        if(tlsRollbackEnabled!=null)
            ssl.setTlsRollbackEnabled(tlsRollbackEnabled.booleanValue());
        if(clientAuthEnabled!=null)
            ssl.setClientAuthEnabled(clientAuthEnabled.booleanValue());
       
        listener.setSsl(ssl);
       
        getConfigContext().flush();
    }
View Full Code Here

     * @param httpListener HTTP listener whose SSL config to use
     */
    private void configureSSL(PECoyoteConnector connector,
                              HttpListener httpListener) {

        Ssl sslConfig = httpListener.getSsl();
        if (sslConfig == null) {
            return;
        }

        // client-auth
        if (sslConfig.isClientAuthEnabled()) {
            connector.setClientAuth(true);
        }

        // ssl protocol variants
        StringBuffer sslProtocolsBuf = new StringBuffer();
        boolean needComma = false;
        if (sslConfig.isSsl2Enabled()) {
            sslProtocolsBuf.append("SSLv2");
            needComma = true;
        }
        if (sslConfig.isSsl3Enabled()) {
            if (needComma) {
                sslProtocolsBuf.append(", ");
            } else {
                needComma = true;
            }
            sslProtocolsBuf.append("SSLv3");
        }
        if (sslConfig.isTlsEnabled()) {
            if (needComma) {
                sslProtocolsBuf.append(", ");
            }
            sslProtocolsBuf.append("TLSv1");
        }
        if (sslConfig.isSsl3Enabled() || sslConfig.isTlsEnabled()) {
            sslProtocolsBuf.append(", SSLv2Hello");
        }

        if (sslProtocolsBuf.length() == 0) {
            _logger.log(Level.WARNING,
                        "pewebcontainer.all_ssl_protocols_disabled",
                        httpListener.getId());
        } else {
            connector.setSslProtocols(sslProtocolsBuf.toString());
        }

        // cert-nickname
        String certNickname = sslConfig.getCertNickname();
        if (certNickname != null && certNickname.length() > 0) {
            connector.setKeyAlias(sslConfig.getCertNickname());
        }

        // ssl3-tls-ciphers
        String ciphers = sslConfig.getSsl3TlsCiphers();
        if (ciphers != null) {
            String jsseCiphers = getJSSECiphers(ciphers);
            if (jsseCiphers == null) {
                _logger.log(Level.WARNING,
                            "pewebcontainer.all_ciphers_disabled",
View Full Code Here

        if(config == null)
        {
            config  = new SslClientConfig();
        }
 
        Ssl ssl = new Ssl();
        //strings
        if(certNickname!=null)
            ssl.setCertNickname(certNickname);
        if(ssl2Ciphers!=null)
            ssl.setSsl2Ciphers(ssl2Ciphers);
        if(ssl3TlsCiphers!=null)
            ssl.setSsl3TlsCiphers(ssl3TlsCiphers);
        //Booleans
        if(ssl2Enabled!=null)
            ssl.setSsl2Enabled(ssl2Enabled.booleanValue());
        if(ssl3Enabled!=null)
            ssl.setSsl3Enabled(ssl3Enabled.booleanValue());
        if(tlsEnabled!=null)
            ssl.setTlsEnabled(tlsEnabled.booleanValue());
        if(tlsRollbackEnabled!=null)
            ssl.setTlsRollbackEnabled(tlsRollbackEnabled.booleanValue());
        if(clientAuthEnabled!=null)
            ssl.setClientAuthEnabled(clientAuthEnabled.booleanValue());
       
        config.setSsl(ssl);
        service.setSslClientConfig(config);
       
        getConfigContext().flush();
View Full Code Here

        final boolean ssl = connectorConfig.isSecurityEnabled();
       
        RMIServerSocketFactory sf = null;
        if (ssl) {
            driver.setSsl(ssl);
            Ssl sslc = connectorConfig.getSsl();
            if (sslc == null)
                sslc = initDefaultSslConfiguration();
            sf = new AdminSslServerSocketFactory(sslc, connectorConfig.getAddress());
            RMIClientSocketFactory cf = new AdminRMISSLClientSocketFactory();
            driver.setRmiClientSocketFactory(cf);
View Full Code Here

            initContext.getConfigContext(), serverName);
        new ServerClientEnvSetter(certNickName).setup();
    }

    private Ssl initDefaultSslConfiguration() {
        Ssl ssl = new Ssl();
        ssl.setCertNickname(ServerHelper.DEFAULT_CERT_NICKNAME);
        ssl.setClientAuthEnabled(false);
        ssl.setSsl2Enabled(false);
        ssl.setSsl3Enabled(true);
        ssl.setTlsEnabled(true);
        ssl.setTlsRollbackEnabled(true);
        return ssl;
    }
View Full Code Here

            JmxConnector connector = new JmxConnector();
            connector.setName(SYSTEM_CONNECTOR_NAME);
            connector.setAddress(host);
            connector.setPort(port);
            connector.setProtocol(protocol);           
            Ssl ssl = new Ssl();
            ssl.setCertNickname(KeystoreManager.CERTIFICATE_ALIAS);
            connector.setSsl(ssl);

            ElementProperty hostnameProperty = new ElementProperty();
            hostnameProperty.setName(HOST_PROPERTY_NAME);
            hostnameProperty.setValue(clientHostName);
View Full Code Here

        String certNickname = null;
        JmxConnector con =
            ServerHelper.getServerSystemConnector(ctx, instanceName);
        if (con != null) {
            Ssl ssl = con.getSsl();
            if (ssl != null) {
                certNickname = ssl.getCertNickname();
            }
        }
        if (certNickname == null) {
            certNickname = DEF_CERT_ALIAS;
        }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.serverbeans.Ssl

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.