use of org.apache.geode.distributed.internal.DistributionConfigImpl 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);
}
}
use of org.apache.geode.distributed.internal.DistributionConfigImpl 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);
}
}
use of org.apache.geode.distributed.internal.DistributionConfigImpl 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);
}
}
use of org.apache.geode.distributed.internal.DistributionConfigImpl in project geode by apache.
the class SocketCreatorFactoryJUnitTest method testNewSSLConfigSSLComponentCLUSTER.
@Test
public void testNewSSLConfigSSLComponentCLUSTER() throws Exception {
Properties properties = configureSSLProperties(SecurableCommunicationChannel.CLUSTER.getConstant());
DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
SocketCreatorFactory.setDistributionConfig(distributionConfig);
assertTrue(SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER).useSSL());
assertFalse(SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.GATEWAY).useSSL());
assertFalse(SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.JMX).useSSL());
assertFalse(SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.SERVER).useSSL());
assertFalse(SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.WEB).useSSL());
assertFalse(SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.LOCATOR).useSSL());
}
use of org.apache.geode.distributed.internal.DistributionConfigImpl in project geode by apache.
the class LogWriterUtils method createLogWriter.
/**
* Creates a new LogWriter and adds it to the config properties. The config can then be used to
* connect to DistributedSystem, thus providing early access to the LogWriter before connecting.
* This call does not connect to the DistributedSystem. It simply creates and returns the
* LogWriter that will eventually be used by the DistributedSystem that connects using config.
*
* @param properties the DistributedSystem config properties to add LogWriter to
* @return early access to the DistributedSystem LogWriter
* @deprecated Please use a <code>Logger</code> from {@link LogService#getLogger()} instead.
*/
public static LogWriter createLogWriter(final Properties properties) {
Properties nonDefault = properties;
if (nonDefault == null) {
nonDefault = new Properties();
}
DistributedTestUtils.addHydraProperties(nonDefault);
DistributionConfig dc = new DistributionConfigImpl(nonDefault);
LogWriter logger = LogWriterFactory.createLogWriterLogger(false, /* isLoner */
false, /* isSecurityLog */
dc, false);
// if config was non-null, then these will be added to it...
nonDefault.put(DistributionConfig.LOG_WRITER_NAME, logger);
return logger;
}
Aggregations