Search in sources :

Example 6 with SecurableCommunicationChannel

use of org.apache.geode.internal.security.SecurableCommunicationChannel in project geode by apache.

the class SSLConfigurationFactoryJUnitTest method getSSLConfigWithCommaDelimitedCiphers.

@Test
public void getSSLConfigWithCommaDelimitedCiphers() throws Exception {
    Properties properties = new Properties();
    properties.setProperty(SSL_ENABLED_COMPONENTS, "all");
    properties.setProperty(SSL_KEYSTORE, "someKeyStore");
    properties.setProperty(SSL_KEYSTORE_PASSWORD, "keystorePassword");
    properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
    properties.setProperty(SSL_TRUSTSTORE, "someKeyStore");
    properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "keystorePassword");
    properties.setProperty(SSL_DEFAULT_ALIAS, "defaultAlias");
    properties.setProperty(SSL_CIPHERS, "Cipher1,Cipher2");
    properties.setProperty(SSL_PROTOCOLS, "any");
    DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
    SSLConfigurationFactory.setDistributionConfig(distributionConfig);
    for (SecurableCommunicationChannel securableCommunicationChannel : SecurableCommunicationChannel.values()) {
        assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableCommunicationChannel), securableCommunicationChannel, distributionConfig);
    }
}
Also used : DistributionConfigImpl(org.apache.geode.distributed.internal.DistributionConfigImpl) Properties(java.util.Properties) RestoreSystemProperties(org.junit.contrib.java.lang.system.RestoreSystemProperties) SecurableCommunicationChannel(org.apache.geode.internal.security.SecurableCommunicationChannel) UnitTest(org.apache.geode.test.junit.categories.UnitTest) Test(org.junit.Test) MembershipTest(org.apache.geode.test.junit.categories.MembershipTest)

Example 7 with SecurableCommunicationChannel

use of org.apache.geode.internal.security.SecurableCommunicationChannel in project geode by apache.

the class SSLConfigurationFactoryJUnitTest method getSSLConfigForComponentHTTPService.

@Test
public void getSSLConfigForComponentHTTPService() throws Exception {
    Properties properties = new Properties();
    properties.setProperty(SSL_ENABLED_COMPONENTS, SecurableCommunicationChannel.WEB.getConstant());
    properties.setProperty(SSL_KEYSTORE, "someKeyStore");
    properties.setProperty(SSL_KEYSTORE_PASSWORD, "keystorePassword");
    properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
    properties.setProperty(SSL_TRUSTSTORE, "someKeyStore");
    properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "keystorePassword");
    properties.setProperty(SSL_DEFAULT_ALIAS, "defaultAlias");
    properties.setProperty(SSL_CIPHERS, "any");
    properties.setProperty(SSL_PROTOCOLS, "any");
    DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
    SSLConfigurationFactory.setDistributionConfig(distributionConfig);
    for (SecurableCommunicationChannel securableCommunicationChannel : SecurableCommunicationChannel.values()) {
        assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableCommunicationChannel), securableCommunicationChannel, distributionConfig);
    }
}
Also used : DistributionConfigImpl(org.apache.geode.distributed.internal.DistributionConfigImpl) Properties(java.util.Properties) RestoreSystemProperties(org.junit.contrib.java.lang.system.RestoreSystemProperties) SecurableCommunicationChannel(org.apache.geode.internal.security.SecurableCommunicationChannel) UnitTest(org.apache.geode.test.junit.categories.UnitTest) Test(org.junit.Test) MembershipTest(org.apache.geode.test.junit.categories.MembershipTest)

Example 8 with SecurableCommunicationChannel

use of org.apache.geode.internal.security.SecurableCommunicationChannel in project geode by apache.

the class SSLConfigurationFactoryJUnitTest method getNonSSLConfiguration.

@Test
public void getNonSSLConfiguration() throws Exception {
    Properties properties = new Properties();
    DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
    SSLConfigurationFactory.setDistributionConfig(distributionConfig);
    for (SecurableCommunicationChannel securableComponent : SecurableCommunicationChannel.values()) {
        assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableComponent), securableComponent, distributionConfig);
    }
}
Also used : DistributionConfigImpl(org.apache.geode.distributed.internal.DistributionConfigImpl) Properties(java.util.Properties) RestoreSystemProperties(org.junit.contrib.java.lang.system.RestoreSystemProperties) SecurableCommunicationChannel(org.apache.geode.internal.security.SecurableCommunicationChannel) UnitTest(org.apache.geode.test.junit.categories.UnitTest) Test(org.junit.Test) MembershipTest(org.apache.geode.test.junit.categories.MembershipTest)

Example 9 with SecurableCommunicationChannel

use of org.apache.geode.internal.security.SecurableCommunicationChannel in project geode by apache.

the class SSLConfigurationFactoryJUnitTest method getSSLConfigForComponentHTTPServiceWithAlias.

@Test
public void getSSLConfigForComponentHTTPServiceWithAlias() throws Exception {
    Properties properties = new Properties();
    properties.setProperty(SSL_ENABLED_COMPONENTS, SecurableCommunicationChannel.WEB.getConstant());
    properties.setProperty(SSL_KEYSTORE, "someKeyStore");
    properties.setProperty(SSL_KEYSTORE_PASSWORD, "keystorePassword");
    properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
    properties.setProperty(SSL_TRUSTSTORE, "someKeyStore");
    properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "keystorePassword");
    properties.setProperty(SSL_DEFAULT_ALIAS, "defaultAlias");
    properties.setProperty(SSL_WEB_ALIAS, "httpAlias");
    properties.setProperty(SSL_CIPHERS, "any");
    properties.setProperty(SSL_PROTOCOLS, "any");
    DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
    SSLConfigurationFactory.setDistributionConfig(distributionConfig);
    for (SecurableCommunicationChannel securableCommunicationChannel : SecurableCommunicationChannel.values()) {
        assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableCommunicationChannel), securableCommunicationChannel, distributionConfig);
    }
}
Also used : DistributionConfigImpl(org.apache.geode.distributed.internal.DistributionConfigImpl) Properties(java.util.Properties) RestoreSystemProperties(org.junit.contrib.java.lang.system.RestoreSystemProperties) SecurableCommunicationChannel(org.apache.geode.internal.security.SecurableCommunicationChannel) UnitTest(org.apache.geode.test.junit.categories.UnitTest) Test(org.junit.Test) MembershipTest(org.apache.geode.test.junit.categories.MembershipTest)

Example 10 with SecurableCommunicationChannel

use of org.apache.geode.internal.security.SecurableCommunicationChannel in project geode by apache.

the class SSLConfigurationFactoryJUnitTest method getSSLConfigWithCommaDelimitedProtocols.

@Test
public void getSSLConfigWithCommaDelimitedProtocols() throws Exception {
    Properties properties = new Properties();
    properties.setProperty(SSL_ENABLED_COMPONENTS, "all");
    properties.setProperty(SSL_KEYSTORE, "someKeyStore");
    properties.setProperty(SSL_KEYSTORE_PASSWORD, "keystorePassword");
    properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
    properties.setProperty(SSL_TRUSTSTORE, "someKeyStore");
    properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "keystorePassword");
    properties.setProperty(SSL_DEFAULT_ALIAS, "defaultAlias");
    properties.setProperty(SSL_CIPHERS, "Cipher1,Cipher2");
    properties.setProperty(SSL_PROTOCOLS, "Protocol1,Protocol2");
    DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
    SSLConfigurationFactory.setDistributionConfig(distributionConfig);
    for (SecurableCommunicationChannel securableComponent : SecurableCommunicationChannel.values()) {
        assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableComponent), securableComponent, distributionConfig);
    }
}
Also used : DistributionConfigImpl(org.apache.geode.distributed.internal.DistributionConfigImpl) Properties(java.util.Properties) RestoreSystemProperties(org.junit.contrib.java.lang.system.RestoreSystemProperties) SecurableCommunicationChannel(org.apache.geode.internal.security.SecurableCommunicationChannel) UnitTest(org.apache.geode.test.junit.categories.UnitTest) Test(org.junit.Test) MembershipTest(org.apache.geode.test.junit.categories.MembershipTest)

Aggregations

SecurableCommunicationChannel (org.apache.geode.internal.security.SecurableCommunicationChannel)10 Properties (java.util.Properties)7 DistributionConfigImpl (org.apache.geode.distributed.internal.DistributionConfigImpl)7 MembershipTest (org.apache.geode.test.junit.categories.MembershipTest)7 UnitTest (org.apache.geode.test.junit.categories.UnitTest)7 Test (org.junit.Test)7 RestoreSystemProperties (org.junit.contrib.java.lang.system.RestoreSystemProperties)7 IOException (java.io.IOException)2 UnknownHostException (java.net.UnknownHostException)2 InternalGemFireException (org.apache.geode.InternalGemFireException)2 Method (java.lang.reflect.Method)1 StringTokenizer (java.util.StringTokenizer)1 GemFireConfigException (org.apache.geode.GemFireConfigException)1 GemFireIOException (org.apache.geode.GemFireIOException)1 UnmodifiableException (org.apache.geode.UnmodifiableException)1 SSLConfig (org.apache.geode.internal.admin.SSLConfig)1