Search in sources :

Example 1 with SSLConfig

use of com.sun.appserv.management.config.SSLConfig in project Payara by payara.

the class HTTPListenerConfigTest method testCreateSSL.

public void testCreateSSL() throws Exception {
    final Map<String, String> options = Collections.unmodifiableMap(MapUtil.newMap(new String[] { CLIENT_AUTH_ENABLED_KEY, "false", SSL_2_ENABLED_KEY, "true", SSL_3_ENABLED_KEY, "true", SSL_2_CIPHERS_KEY, "+rc4,-rc4export,-rc2,-rc2export,+idea,+des,+desede3", SSL3_TLS_CIPHERS_KEY, "+rsa_rc4_128_md5,+rsa3des_sha,+rsa_des_sha,-rsa_rc4_40_md5" + "-rsa_rc2_40_md5,-rsa_null_md5,-rsa_des_56_sha,-rsa_rc4_56_sha", TLS_ENABLED_KEY, "true", TLS_ROLLBACK_ENABLED_KEY, "true" }));
    if (!checkNotOffline("testCreateSSL")) {
        return;
    }
    final String NAME = "HTTPListenerConfigMgr-listener-for-testCreateSSL";
    try {
        removeEx(NAME);
        final HTTPListenerConfig newListener = (HTTPListenerConfig) createProgeny(NAME, null);
        assert newListener != null;
        // verify that the new listener is present
        final Map<String, HTTPListenerConfig> listeners = getHTTPService().getHTTPListenerConfigMap();
        final HTTPListenerConfig listener = listeners.get(NAME);
        assert listener != null;
        assert listener == newListener;
        final String CERT_NICKNAME = NAME + "Cert";
        final SSLConfig ssl = listener.createSSLConfig(CERT_NICKNAME, options);
        assert ssl != null;
        assert ssl.getCertNickname().equals(CERT_NICKNAME);
        listener.removeSSLConfig();
    } finally {
        remove(NAME);
    }
}
Also used : SSLConfig(com.sun.appserv.management.config.SSLConfig) HTTPListenerConfig(com.sun.appserv.management.config.HTTPListenerConfig)

Example 2 with SSLConfig

use of com.sun.appserv.management.config.SSLConfig in project Payara by payara.

the class SSLConfigTest method testGetAttrs.

public void testGetAttrs() {
    final QueryMgr queryMgr = getQueryMgr();
    final String props = Util.makeJ2EETypeProp(XTypes.SSL_CONFIG);
    final Set sslConfigs = queryMgr.queryPropsSet(props);
    final Iterator iter = sslConfigs.iterator();
    while (iter.hasNext()) {
        final SSLConfig ssl = (SSLConfig) iter.next();
        ssl.getCertNickname();
        ssl.getClientAuthEnabled();
        ssl.getSSL2Enabled();
        ssl.getSSL2Ciphers();
        ssl.getSSL3Enabled();
        ssl.getSSL3TLSCiphers();
        ssl.getTLSEnabled();
        ssl.getTLSRollbackEnabled();
    }
}
Also used : QueryMgr(com.sun.appserv.management.base.QueryMgr) SSLConfig(com.sun.appserv.management.config.SSLConfig) Set(java.util.Set) Iterator(java.util.Iterator)

Example 3 with SSLConfig

use of com.sun.appserv.management.config.SSLConfig in project Payara by payara.

the class IIOPListenerConfigTest method testCreateSSL.

public void testCreateSSL() throws Exception {
    if (!checkNotOffline("testCreateSSL")) {
        return;
    }
    final String NAME = "IIOPListenerConfigMgr-testCreateSSL";
    removeEx(NAME);
    final IIOPListenerConfig newListener = (IIOPListenerConfig) createProgeny(NAME, null);
    try {
        final Map<String, IIOPListenerConfig> listeners = getIIOPService().getIIOPListenerConfigMap();
        final IIOPListenerConfig listener = (IIOPListenerConfig) listeners.get(NAME);
        assert listener != null;
        assert listener == newListener;
        final String CERT_NICKNAME = NAME + "Cert";
        final SSLConfig ssl = listener.createSSLConfig(CERT_NICKNAME, null);
        assert ssl != null;
        assert ssl.getCertNickname().equals(CERT_NICKNAME);
        listener.removeSSLConfig();
    } finally {
        remove(NAME);
    }
}
Also used : SSLConfig(com.sun.appserv.management.config.SSLConfig) IIOPListenerConfig(com.sun.appserv.management.config.IIOPListenerConfig)

Example 4 with SSLConfig

use of com.sun.appserv.management.config.SSLConfig in project Payara by payara.

the class JMXConnectorConfigTest method testCreateSSL.

public void testCreateSSL() throws Exception {
    if (!checkNotOffline("testCreateSSL")) {
        return;
    }
    final String NAME = "JMXConnectorConfigTest-testCreateSSL";
    try {
        removeEx(NAME);
        final JMXConnectorConfig newConfig = (JMXConnectorConfig) createProgeny(NAME, null);
        final Map<String, JMXConnectorConfig> jmxConnectors = getAdminServiceConfig().getJMXConnectorConfigMap();
        final JMXConnectorConfig jmxConnector = (JMXConnectorConfig) jmxConnectors.get(NAME);
        assert jmxConnector != null;
        assert jmxConnector == newConfig;
        final String CERT_NICKNAME = NAME + "Cert";
        final SSLConfig ssl = jmxConnector.createSSLConfig(CERT_NICKNAME, null);
        assert ssl != null;
        assert ssl.getCertNickname().equals(CERT_NICKNAME);
        jmxConnector.removeSSLConfig();
    } finally {
        remove(NAME);
    }
}
Also used : SSLConfig(com.sun.appserv.management.config.SSLConfig) JMXConnectorConfig(com.sun.appserv.management.config.JMXConnectorConfig)

Aggregations

SSLConfig (com.sun.appserv.management.config.SSLConfig)4 QueryMgr (com.sun.appserv.management.base.QueryMgr)1 HTTPListenerConfig (com.sun.appserv.management.config.HTTPListenerConfig)1 IIOPListenerConfig (com.sun.appserv.management.config.IIOPListenerConfig)1 JMXConnectorConfig (com.sun.appserv.management.config.JMXConnectorConfig)1 Iterator (java.util.Iterator)1 Set (java.util.Set)1