Search in sources :

Example 1 with MCMPHandlerConfiguration

use of org.jboss.modcluster.config.MCMPHandlerConfiguration in project wildfly by wildfly.

the class ModClusterSubsystemParsingTestCase method testSSL.

@Ignore
@Test
public void testSSL() throws Exception {
    if (schema != ModClusterSchema.CURRENT)
        return;
    KernelServicesBuilder builder = createKernelServicesBuilder(new AdditionalInitialization()).setSubsystemXml(getSubsystemXml());
    KernelServices services = builder.build();
    ModelNode model = services.readWholeModel();
    ModelNode config = model.get(SUBSYSTEM, getMainSubsystemName()).get(MOD_CLUSTER_CONFIG, CONFIGURATION);
    ModelNode ssl = config.get(SSL, CONFIGURATION);
    Assert.assertEquals("/home/rhusar/client-keystore.jks", ssl.get("ca-certificate-file").resolve().asString());
    Assert.assertEquals("/home/rhusar/revocations", ssl.get("ca-revocation-url").resolve().asString());
    Assert.assertEquals("/home/rhusar/client-keystore.jks", ssl.get("certificate-key-file").resolve().asString());
    Assert.assertEquals("SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_RC4_128_SHA,SSL_RSA_WITH_3DES_EDE_CBC_SHA", ssl.get("cipher-suite").resolve().asString());
    Assert.assertEquals("mykeyalias", ssl.get("key-alias").resolve().asString());
    Assert.assertEquals("mypassword", ssl.get("password").resolve().asString());
    Assert.assertEquals("TLSv1", ssl.get("protocol").resolve().asString());
    ServiceController<?> service = services.getContainer().getService(ContainerEventHandlerService.CONFIG_SERVICE_NAME);
    MCMPHandlerConfiguration mcmpHandlerConfiguration = (MCMPHandlerConfiguration) service.getValue();
    Assert.assertTrue(mcmpHandlerConfiguration.isSsl());
    SSLConfiguration sslConfig = (SSLConfiguration) service.getValue();
    Assert.assertEquals("mykeyalias", sslConfig.getSslKeyAlias());
    Assert.assertEquals("mypassword", sslConfig.getSslTrustStorePassword());
    Assert.assertEquals("mypassword", sslConfig.getSslKeyStorePassword());
    Assert.assertEquals("/home/rhusar/client-keystore.jks", sslConfig.getSslKeyStore());
    Assert.assertEquals("SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_RC4_128_SHA,SSL_RSA_WITH_3DES_EDE_CBC_SHA", sslConfig.getSslCiphers());
    Assert.assertEquals("TLSv1", sslConfig.getSslProtocol());
    Assert.assertEquals("/home/rhusar/client-keystore.jks", sslConfig.getSslTrustStore());
    Assert.assertEquals("/home/rhusar/revocations", sslConfig.getSslCrlFile());
}
Also used : MCMPHandlerConfiguration(org.jboss.modcluster.config.MCMPHandlerConfiguration) SSLConfiguration(org.jboss.modcluster.config.SSLConfiguration) KernelServices(org.jboss.as.subsystem.test.KernelServices) ModelNode(org.jboss.dmr.ModelNode) KernelServicesBuilder(org.jboss.as.subsystem.test.KernelServicesBuilder) AdditionalInitialization(org.jboss.as.subsystem.test.AdditionalInitialization) Ignore(org.junit.Ignore) ClusteringSubsystemTest(org.jboss.as.clustering.subsystem.ClusteringSubsystemTest) Test(org.junit.Test)

Aggregations

ClusteringSubsystemTest (org.jboss.as.clustering.subsystem.ClusteringSubsystemTest)1 AdditionalInitialization (org.jboss.as.subsystem.test.AdditionalInitialization)1 KernelServices (org.jboss.as.subsystem.test.KernelServices)1 KernelServicesBuilder (org.jboss.as.subsystem.test.KernelServicesBuilder)1 ModelNode (org.jboss.dmr.ModelNode)1 MCMPHandlerConfiguration (org.jboss.modcluster.config.MCMPHandlerConfiguration)1 SSLConfiguration (org.jboss.modcluster.config.SSLConfiguration)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1