Search in sources :

Example 1 with HTTPListenerConfig

use of com.sun.appserv.management.config.HTTPListenerConfig 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 HTTPListenerConfig

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

the class HTTPListenerConfigTest method testGetHTTPListeners.

public void testGetHTTPListeners() {
    final HTTPServiceConfig httpService = getConfigConfig().getHTTPServiceConfig();
    final Map<String, HTTPListenerConfig> proxies = httpService.getHTTPListenerConfigMap();
    for (final String listenerName : proxies.keySet()) {
        final HTTPListenerConfig listener = (HTTPListenerConfig) proxies.get(listenerName);
        listener.getEnabled();
    }
}
Also used : HTTPListenerConfig(com.sun.appserv.management.config.HTTPListenerConfig) HTTPServiceConfig(com.sun.appserv.management.config.HTTPServiceConfig)

Example 3 with HTTPListenerConfig

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

the class HTTPListenerConfigTest method createProgeny.

protected final AMXConfig createProgeny(final String name, final Map<String, String> options) {
    // this is incorrect code-on purpose-to test backward compatibility with Maps
    // that aren't of type <String,String>
    final Map<String, String> optional = TypeCast.asMap(OPTIONAL);
    assert (!MapUtil.isAllStrings(optional));
    final Map<String, String> allOptions = MapUtil.newMap(options, optional);
    assert (!MapUtil.isAllStrings(allOptions));
    final int port = 31000 + (name.hashCode() % 31000);
    final HTTPListenerConfig config = getHTTPService().createHTTPListenerConfig(name, ADDRESS, port, DEF_VIRTUAL_SERVER, SERVER_NAME, allOptions);
    return (config);
}
Also used : HTTPListenerConfig(com.sun.appserv.management.config.HTTPListenerConfig)

Aggregations

HTTPListenerConfig (com.sun.appserv.management.config.HTTPListenerConfig)3 HTTPServiceConfig (com.sun.appserv.management.config.HTTPServiceConfig)1 SSLConfig (com.sun.appserv.management.config.SSLConfig)1