use of org.apache.geode.distributed.internal.DistributionConfigImpl in project geode by apache.
the class HTTPServiceSSLSupportJUnitTest method testSSLWithDeprecatedClusterSSL_HTTPService_WithSSL_Properties.
@Test
public void testSSLWithDeprecatedClusterSSL_HTTPService_WithSSL_Properties() throws Exception {
Properties localProps = new Properties();
localProps.setProperty(MCAST_PORT, "0");
localProps.setProperty(CLUSTER_SSL_ENABLED, "true");
localProps.setProperty(CLUSTER_SSL_PROTOCOLS, "SSL");
localProps.setProperty(CLUSTER_SSL_REQUIRE_AUTHENTICATION, "true");
Properties sslProps = new Properties();
sslProps.setProperty("javax.net.ssl.keyStore", jks.getCanonicalPath());
sslProps.setProperty("javax.net.ssl.keyStorePassword", "password");
sslProps.setProperty("javax.net.ssl.trustStore", jks.getCanonicalPath());
sslProps.setProperty("javax.net.ssl.trustStorePassword", "password");
localProps.putAll(sslProps);
DistributionConfigImpl config = new DistributionConfigImpl(localProps);
assertEquals(config.getHttpServiceSSLEnabled(), true);
assertEquals(config.getHttpServiceSSLProtocols(), "SSL");
assertEquals(config.getHttpServiceSSLRequireAuthentication(), true);
assertEquals(jks.getCanonicalPath(), config.getHttpServiceSSLProperties().get("javax.net.ssl.keyStore"));
assertEquals("password", config.getHttpServiceSSLProperties().get("javax.net.ssl.keyStorePassword"));
assertEquals(jks.getCanonicalPath(), config.getHttpServiceSSLProperties().get("javax.net.ssl.trustStore"));
assertEquals("password", config.getHttpServiceSSLProperties().get("javax.net.ssl.trustStorePassword"));
}
Aggregations