You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ds...@apache.org on 2015/10/15 02:16:59 UTC
[1/2] incubator-geode git commit: GEODE-405: sameAs needs to ignore
ssl-* properties
Repository: incubator-geode
Updated Branches:
refs/heads/feature/GEODE-397 4a26338b1 -> 47ad35dc7
GEODE-405: sameAs needs to ignore ssl-* properties
Since toProperties does not include ssl-* properties
sameAs needs to also ignore ssl-* properties.
Since the ssl-* are always copied to cluster-ssl-*
and sameAs compares these it will still return false
if the ssl-* properties had different values.
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/dd874074
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/dd874074
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/dd874074
Branch: refs/heads/feature/GEODE-397
Commit: dd8740741c34ecef252522edfbd728baca9e5de7
Parents: 4a26338
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Wed Oct 14 16:23:56 2015 -0700
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Wed Oct 14 16:23:56 2015 -0700
----------------------------------------------------------------------
.../gemfire/internal/AbstractConfig.java | 6 +++++
.../InternalDistributedSystemJUnitTest.java | 24 ++++++++++++++++++++
2 files changed, 30 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dd874074/gemfire-core/src/main/java/com/gemstone/gemfire/internal/AbstractConfig.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/AbstractConfig.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/AbstractConfig.java
index 75e4314..2bb047d 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/AbstractConfig.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/AbstractConfig.java
@@ -276,6 +276,12 @@ public abstract class AbstractConfig implements Config {
String[] validAttributeNames = getAttributeNames();
for (int i=0; i < validAttributeNames.length; i++) {
String attName = validAttributeNames[i];
+ if (this.isDeprecated(attName)) {
+ // since toProperties skips isDeprecated sameAs
+ // needs to also skip them.
+ // See GEODE-405.
+ continue;
+ }
Object thisAtt = this.getAttributeObject(attName);
Object otherAtt = other.getAttributeObject(attName);
if (thisAtt == otherAtt) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dd874074/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystemJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystemJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystemJUnitTest.java
index 88a0654..3af05cb 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystemJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystemJUnitTest.java
@@ -704,6 +704,7 @@ public class InternalDistributedSystemJUnitTest
try {
sys.validateSameProperties(config2.toProperties(), true);
+ fail("should have detected different mcast-ports");
} catch (IllegalStateException iex) {
// This passes the test
}
@@ -712,6 +713,29 @@ public class InternalDistributedSystemJUnitTest
sys.disconnect();
}
}
+ @Test
+ public void testDeprecatedSSLProps() {
+ Properties props = new Properties();
+ props.setProperty("mcast-port", "0");
+ props.setProperty("locators", "");
+ props.setProperty("ssl-enabled", "true");
+ Config config1 = new DistributionConfigImpl(props, false);
+ Properties props1 = config1.toProperties();
+ // For the deprecated ssl-* properties a decision was made
+ // to not include them in the result of "toProperties".
+ // The cause of this is: com.gemstone.gemfire.internal.AbstractConfig.isDeprecated(String)
+ // and its use in toProperties.
+ // The other thing that is done is the ssl-* props are copied to cluster-ssl-*.
+ // The following two assertions demonstrate this.
+ assertEquals(null, props1.getProperty("ssl-enabled"));
+ assertEquals("true", props1.getProperty("cluster-ssl-enabled"));
+ Config config2 = new DistributionConfigImpl(props1, false);
+ assertEquals(true, config1.sameAs(config2));
+ Properties props3 = new Properties(props1);
+ props3.setProperty("ssl-enabled", "false");
+ Config config3 = new DistributionConfigImpl(props3, false);
+ assertEquals(false, config1.sameAs(config3));
+ }
public static String getHostAddress(InetAddress addr) {
String address = addr.getHostAddress();
if (addr instanceof Inet4Address
[2/2] incubator-geode git commit: working on
CacheServerSSLConnectionDUnit to get this test working
Posted by ds...@apache.org.
working on CacheServerSSLConnectionDUnit to get this test working
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/47ad35dc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/47ad35dc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/47ad35dc
Branch: refs/heads/feature/GEODE-397
Commit: 47ad35dc73d8fc2a6a06e365fe1ad94eaf3b6071
Parents: dd87407
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Wed Oct 14 17:16:04 2015 -0700
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Wed Oct 14 17:16:04 2015 -0700
----------------------------------------------------------------------
.../internal/CacheServerSSLConnectionDUnit.java | 164 +++++++++++--------
.../cache/client/internal/cacheserver.cer | Bin 0 -> 782 bytes
.../cache/client/internal/cacheserver.keystore | Bin 0 -> 1253 bytes
.../client/internal/cacheserver.truststore | Bin 0 -> 844 bytes
.../gemfire/cache/client/internal/client.cer | Bin 0 -> 782 bytes
.../cache/client/internal/client.keystore | Bin 0 -> 1251 bytes
.../cache/client/internal/client.truststore | Bin 0 -> 846 bytes
.../cache/client/internal/trusted.keystore | Bin 0 -> 1078 bytes
8 files changed, 100 insertions(+), 64 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/47ad35dc/gemfire-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnit.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnit.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnit.java
index 7bf7c7e..28b5010 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnit.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnit.java
@@ -32,10 +32,12 @@ import com.gemstone.gemfire.distributed.Locator;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.AvailablePortHelper;
import com.gemstone.gemfire.security.AuthenticationRequiredException;
+import com.gemstone.gemfire.util.test.TestUtil;
import dunit.DistributedTestCase;
import dunit.Host;
import dunit.VM;
+import dunit.DistributedTestCase.ExpectedException;
/**
* Tests cacheserver ssl support added. See https://svn.gemstone.com/trac/gemfire/ticket/48995 for details
@@ -54,8 +56,6 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
private int locatorPort;
private Locator locator;
- private static final String jtests = System.getProperty("JTESTS");
-
private static final String TRUSTED_STORE = "trusted.keystore";
private static final String CLIENT_KEY_STORE = "client.keystore";
private static final String CLIENT_TRUST_STORE = "client.truststore";
@@ -112,12 +112,6 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
String cacheServerSslprotocols = "any";
String cacheServerSslciphers = "any";
boolean cacheServerSslRequireAuth = true;
-
- String filePathPrefix = jtests
- + File.separator
- + makePath(new String[] { "com", "gemstone", "gemfire", "cache",
- "client", "internal" });
-
if (!p2pProps) {
gemFireProps.put(DistributionConfig.SERVER_SSL_ENABLED_NAME,
String.valueOf(cacheServerSslenabled));
@@ -129,12 +123,12 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
DistributionConfig.SERVER_SSL_REQUIRE_AUTHENTICATION_NAME,
String.valueOf(cacheServerSslRequireAuth));
+ String keyStore = TestUtil.getResourcePath(CacheServerSSLConnectionDUnit.class, SERVER_KEY_STORE);
+ String trustStore = TestUtil.getResourcePath(CacheServerSSLConnectionDUnit.class, SERVER_TRUST_STORE);
gemFireProps.put(DistributionConfig.SERVER_SSL_KEYSTORE_TYPE_NAME, "jks");
- gemFireProps.put(DistributionConfig.SERVER_SSL_KEYSTORE_NAME, filePathPrefix
- + SERVER_KEY_STORE);
+ gemFireProps.put(DistributionConfig.SERVER_SSL_KEYSTORE_NAME, keyStore);
gemFireProps.put(DistributionConfig.SERVER_SSL_KEYSTORE_PASSWORD_NAME, "password");
- gemFireProps.put(DistributionConfig.SERVER_SSL_TRUSTSTORE_NAME, filePathPrefix
- + SERVER_TRUST_STORE);
+ gemFireProps.put(DistributionConfig.SERVER_SSL_TRUSTSTORE_NAME, trustStore);
gemFireProps.put(DistributionConfig.SERVER_SSL_TRUSTSTORE_PASSWORD_NAME, "password");
} else {
@@ -148,10 +142,12 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
DistributionConfig.SSL_REQUIRE_AUTHENTICATION_NAME,
String.valueOf(cacheServerSslRequireAuth));
+ String keyStore = TestUtil.getResourcePath(CacheServerSSLConnectionDUnit.class, TRUSTED_STORE);
+ String trustStore = TestUtil.getResourcePath(CacheServerSSLConnectionDUnit.class, TRUSTED_STORE);
gemFireProps.put("javax.net.ssl.keyStoreType", "jks");
- gemFireProps.put("javax.net.ssl.keyStore", filePathPrefix + TRUSTED_STORE);
+ gemFireProps.put("javax.net.ssl.keyStore", keyStore);
gemFireProps.put("javax.net.ssl.keyStorePassword", "password");
- gemFireProps.put("javax.net.ssl.trustStore", filePathPrefix + TRUSTED_STORE);
+ gemFireProps.put("javax.net.ssl.trustStore", trustStore);
gemFireProps.put("javax.net.ssl.trustStorePassword", "password");
gemFireProps.put(DistributionConfig.LOCATORS_NAME, locators);
}
@@ -185,11 +181,8 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
String cacheServerSslprotocols = "any";
String cacheServerSslciphers = "any";
- String filePathPrefix = jtests
- + File.separator
- + makePath(new String[] { "com", "gemstone", "gemfire", "cache",
- "client", "internal" });
-
+ String keyStorePath = TestUtil.getResourcePath(CacheServerSSLConnectionDUnit.class, keyStore);
+ String trustStorePath = TestUtil.getResourcePath(CacheServerSSLConnectionDUnit.class, trustStore);
//using new server-ssl-* properties
if (!p2pProps) {
gemFireProps.put(DistributionConfig.SERVER_SSL_ENABLED_NAME,
@@ -203,11 +196,9 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
String.valueOf(cacheServerSslRequireAuth));
gemFireProps.put(DistributionConfig.SERVER_SSL_KEYSTORE_TYPE_NAME, "jks");
- gemFireProps.put(DistributionConfig.SERVER_SSL_KEYSTORE_NAME, filePathPrefix
- + keyStore);
+ gemFireProps.put(DistributionConfig.SERVER_SSL_KEYSTORE_NAME, keyStorePath);
gemFireProps.put(DistributionConfig.SERVER_SSL_KEYSTORE_PASSWORD_NAME, "password");
- gemFireProps.put(DistributionConfig.SERVER_SSL_TRUSTSTORE_NAME, filePathPrefix
- + trustStore);
+ gemFireProps.put(DistributionConfig.SERVER_SSL_TRUSTSTORE_NAME, trustStorePath);
gemFireProps.put(DistributionConfig.SERVER_SSL_TRUSTSTORE_PASSWORD_NAME, "password");
} else {
//using p2p ssl-* properties
@@ -222,9 +213,9 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
String.valueOf(cacheServerSslRequireAuth));
gemFireProps.put("javax.net.ssl.keyStoreType", "jks");
- gemFireProps.put("javax.net.ssl.keyStore", filePathPrefix+ keyStore);
+ gemFireProps.put("javax.net.ssl.keyStore", keyStorePath);
gemFireProps.put("javax.net.ssl.keyStorePassword", "password");
- gemFireProps.put("javax.net.ssl.trustStore", filePathPrefix + trustStore);
+ gemFireProps.put("javax.net.ssl.trustStore", trustStorePath);
gemFireProps.put("javax.net.ssl.trustStorePassword", "password");
}
@@ -287,11 +278,15 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
}
public static void closeCacheTask(){
- instance.cache.close();
+ if (instance != null && instance.cache != null) {
+ instance.cache.close();
+ }
}
public static void closeClientCacheTask(){
- instance.clientCache.close();
+ if (instance != null && instance.clientCache != null) {
+ instance.clientCache.close();
+ }
}
public static void setUpSSLLocatorVMTask() throws Exception {
@@ -303,26 +298,24 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
String cacheServerSslprotocols = "any";
String cacheServerSslciphers = "any";
- String filePathPrefix = jtests
- + File.separator
- + makePath(new String[] { "com", "gemstone", "gemfire", "cache",
- "client", "internal" });
- props.put(DistributionConfig.SSL_ENABLED_NAME,
+ props.put(DistributionConfig.CLUSTER_SSL_ENABLED_NAME,
String.valueOf(true));
- props.put(DistributionConfig.SSL_PROTOCOLS_NAME,
+ props.put(DistributionConfig.CLUSTER_SSL_PROTOCOLS_NAME,
cacheServerSslprotocols);
- props.put(DistributionConfig.SSL_CIPHERS_NAME,
+ props.put(DistributionConfig.CLUSTER_SSL_CIPHERS_NAME,
cacheServerSslciphers);
props.put(
- DistributionConfig.SSL_REQUIRE_AUTHENTICATION_NAME,
+ DistributionConfig.CLUSTER_SSL_REQUIRE_AUTHENTICATION_NAME,
String.valueOf(true));
props.put("javax.net.ssl.keyStoreType", "jks");
- props.put("javax.net.ssl.keyStore", filePathPrefix + TRUSTED_STORE);
+ String keyStorePath = TestUtil.getResourcePath(CacheServerSSLConnectionDUnit.class, TRUSTED_STORE);
+ String trustStorePath = TestUtil.getResourcePath(CacheServerSSLConnectionDUnit.class, TRUSTED_STORE);
+ props.put("javax.net.ssl.keyStore", keyStorePath);
props.put("javax.net.ssl.keyStorePassword", "password");
- props.put("javax.net.ssl.trustStore", filePathPrefix + TRUSTED_STORE);
+ props.put("javax.net.ssl.trustStore", trustStorePath);
props.put("javax.net.ssl.trustStorePassword", "password");
StringWriter sw = new StringWriter();
PrintWriter writer = new PrintWriter(sw);
@@ -339,7 +332,7 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
fail("While resolving bind address ", uhe);
}
props.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false");
- instance.locator = Locator.startLocatorAndDS(instance.locatorPort, logFile, bindAddr, props);
+ instance.locator = Locator.startLocatorAndDS(instance.locatorPort, logFile, bindAddr, props);
} catch (IOException ex) {
fail("While starting locator on port " + instance.locatorPort, ex);
}
@@ -364,7 +357,7 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
/*
* Tests that cacheserver started with ssl-enabled properties accepts connection with client configured with ssl-enabled property
*/
- public void testCacheServerSSL_OldWay_P2P() throws Exception {
+ public void DISABLEtestCacheServerSSL_OldWay_P2P() throws Exception {
final Host host = Host.getHost(0);
VM serverVM = host.getVM(1);
VM clientVM = host.getVM(2);
@@ -375,8 +368,6 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
boolean cacheClientSslRequireAuth = true;
boolean useP2pSSLProperties = true;
- getLogWriter().info("JTESTS : " + System.getProperty("JTESTS"));
-
//start SSL Locator
locatorVM.invoke(CacheServerSSLConnectionDUnit.class, "setUpSSLLocatorVMTask");
String locatorport = (String)locatorVM.invoke(CacheServerSSLConnectionDUnit.class, "getLocatorPortTask");
@@ -410,7 +401,7 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
/*
* Tests that cacheserver started with ssl-enabled properties accepts connection with client configured with ssl-enabled property
*/
- public void testCacheServerSSL_ServerOldWay_ClientNewWay() throws Exception {
+ public void DISABLEtestCacheServerSSL_ServerOldWay_ClientNewWay() throws Exception {
final Host host = Host.getHost(0);
VM serverVM = host.getVM(1);
VM clientVM = host.getVM(2);
@@ -421,8 +412,6 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
boolean cacheClientSslRequireAuth = true;
boolean useP2pSSLProperties = true;
- getLogWriter().info("JTESTS : " + System.getProperty("JTESTS"));
-
//start SSL Locator
locatorVM.invoke(CacheServerSSLConnectionDUnit.class, "setUpSSLLocatorVMTask");
String locatorport = (String)locatorVM.invoke(CacheServerSSLConnectionDUnit.class, "getLocatorPortTask");
@@ -464,8 +453,6 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
boolean cacheClientSslRequireAuth = true;
boolean useP2pSSLProperties = true;
- getLogWriter().info("JTESTS : " + System.getProperty("JTESTS"));
-
serverVM.invoke(CacheServerSSLConnectionDUnit.class, "setUpServerVMTask", new Object[]{cacheServerSslenabled, !useP2pSSLProperties,null});
serverVM.invoke(CacheServerSSLConnectionDUnit.class, "createServerTask");
@@ -499,8 +486,6 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
boolean cacheClientSslRequireAuth = true;
boolean useP2pSSLProperties = true;
- getLogWriter().info("JTESTS : " + System.getProperty("JTESTS"));
-
serverVM.invoke(CacheServerSSLConnectionDUnit.class, "setUpServerVMTask", new Object[]{cacheServerSslenabled, !useP2pSSLProperties, null});
serverVM.invoke(CacheServerSSLConnectionDUnit.class, "createServerTask");
@@ -516,12 +501,14 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
params[5] = null;
params[6] = TRUSTED_STORE;
params[7] = TRUSTED_STORE;
+ ExpectedException expect = addExpectedException("javax.net.ssl.SSLException", serverVM);
+ ExpectedException expect2 = addExpectedException("IOException", serverVM);
try{
getLogWriter().info("Starting client with server endpoint " + hostName + ":" + port);
clientVM.invoke(CacheServerSSLConnectionDUnit.class, "setUpClientVMTask", params);
clientVM.invoke(CacheServerSSLConnectionDUnit.class, "doClientRegionTestTask");
serverVM.invoke(CacheServerSSLConnectionDUnit.class, "doServerRegionTestTask");
- fail("Test should fail as non-ssl client is tryting to connect to ssl configured server");
+ fail("Test should fail as non-ssl client is trying to connect to ssl configured server");
} catch (Exception rmiException) {
Throwable e = rmiException.getCause();
getLogWriter().info("ExceptionCause at clientVM " + e);
@@ -534,35 +521,40 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
fail("Unexpected Exception...expected "
+ AuthenticationRequiredException.class);
}
+ } finally {
+ expect.remove();
+ expect2.remove();
}
}
- /* It seems it is allowed if client chooses to not insist on authentication. wierd let this test fail??? */
- /*
+ /* It seems it is allowed if client chooses to not insist on authentication. weird let this test fail??? */
public void testSSLClientWithNoAuth() throws Exception {
final Host host = Host.getHost(0);
VM serverVM = host.getVM(1);
VM clientVM = host.getVM(2);
-
+
boolean cacheServerSslenabled = true;
boolean cacheClientSslenabled = true;
boolean cacheClientSslRequireAuth = false;
-
- getLogWriter().info("JTESTS : " + System.getProperty("JTESTS"));
-
- serverVM.invoke(CacheServerSSLConnectionDUnit.class, "setUpServerVMTask", new Object[]{cacheServerSslenabled, null});
+ boolean useP2pSSLProperties = true;
+
+ serverVM.invoke(CacheServerSSLConnectionDUnit.class, "setUpServerVMTask", new Object[]{cacheServerSslenabled, !useP2pSSLProperties,null});
serverVM.invoke(CacheServerSSLConnectionDUnit.class, "createServerTask");
-
+
Object array[] = (Object[])serverVM.invoke(CacheServerSSLConnectionDUnit.class, "getCacheServerEndPointTask");
String hostName = (String)array[0];
int port = (Integer) array[1];
- Object params[] = new Object[4];
+ Object params[] = new Object[8];
params[0] = hostName;
params[1] = port;
params[2] = cacheClientSslenabled;
params[3] = cacheClientSslRequireAuth;
- try{
- getLogWriter().info("Starting client with server endpoint " + hostName + ":" + port);
+ params[4] = !useP2pSSLProperties; //using new server-ssl properties not p2p ssl properties
+ params[5] = null;
+ params[6] = CLIENT_KEY_STORE;
+ params[7] = CLIENT_TRUST_STORE;
+ getLogWriter().info("Starting client with server endpoint " + hostName + ":" + port);
+ try {
clientVM.invoke(CacheServerSSLConnectionDUnit.class, "setUpClientVMTask", params);
clientVM.invoke(CacheServerSSLConnectionDUnit.class, "doClientRegionTestTask");
serverVM.invoke(CacheServerSSLConnectionDUnit.class, "doServerRegionTestTask");
@@ -580,7 +572,50 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
+ AuthenticationRequiredException.class);
}
}
- }*/
+ }
+// final Host host = Host.getHost(0);
+// VM serverVM = host.getVM(1);
+// VM clientVM = host.getVM(2);
+//
+// boolean cacheServerSslenabled = true;
+// boolean cacheClientSslenabled = true;
+// boolean cacheClientSslRequireAuth = true;
+//
+// serverVM.invoke(CacheServerSSLConnectionDUnit.class, "setUpServerVMTask", new Object[]{cacheServerSslenabled, false, null});
+// serverVM.invoke(CacheServerSSLConnectionDUnit.class, "createServerTask");
+//
+// Object array[] = (Object[])serverVM.invoke(CacheServerSSLConnectionDUnit.class, "getCacheServerEndPointTask");
+// String hostName = (String)array[0];
+// int port = (Integer) array[1];
+// Object params[] = new Object[8];
+// params[0] = hostName;
+// params[1] = port;
+// params[2] = cacheClientSslenabled;
+// params[3] = cacheClientSslRequireAuth;
+// params[4] = false;
+// params[5] = null;
+// params[6] = TRUSTED_STORE;
+// params[7] = TRUSTED_STORE;
+// try{
+// getLogWriter().info("Starting client with server endpoint " + hostName + ":" + port);
+// clientVM.invoke(CacheServerSSLConnectionDUnit.class, "setUpClientVMTask", params);
+// clientVM.invoke(CacheServerSSLConnectionDUnit.class, "doClientRegionTestTask");
+// serverVM.invoke(CacheServerSSLConnectionDUnit.class, "doServerRegionTestTask");
+// fail("Test should fail as ssl client with wrong config(SslRequireAuth=false) is trying to connect to ssl configured server");
+// } catch (Exception rmiException) {
+// Throwable e = rmiException.getCause();
+// getLogWriter().info("ExceptionCause at clientVM " + e);
+// if (e instanceof com.gemstone.gemfire.cache.client.ServerOperationException) {
+// Throwable t = e.getCause();
+// getLogWriter().info("Cause is " + t);
+// assertTrue(t instanceof com.gemstone.gemfire.security.AuthenticationRequiredException);
+// } else {
+// getLogWriter().error("Unexpected exception ", e);
+// fail("Unexpected Exception...expected "
+// + AuthenticationRequiredException.class);
+// }
+// }
+// }
public void testSSLClientWithNonSSLServer() throws Exception {
@@ -593,8 +628,6 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
boolean cacheClientSslRequireAuth = true;
boolean useP2pSSLProperties = true;
- getLogWriter().info("JTESTS : " + System.getProperty("JTESTS"));
-
serverVM.invoke(CacheServerSSLConnectionDUnit.class, "setUpServerVMTask", new Object[]{cacheServerSslenabled, !useP2pSSLProperties, null});
serverVM.invoke(CacheServerSSLConnectionDUnit.class, "createServerTask");
@@ -610,12 +643,13 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
params[5] = null;
params[6] = TRUSTED_STORE;
params[7] = TRUSTED_STORE;
+ ExpectedException expect = addExpectedException("javax.net.ssl.SSLHandshakeException", serverVM);
try{
getLogWriter().info("Starting client with server endpoint " + hostName + ":" + port);
clientVM.invoke(CacheServerSSLConnectionDUnit.class, "setUpClientVMTask", params);
clientVM.invoke(CacheServerSSLConnectionDUnit.class, "doClientRegionTestTask");
serverVM.invoke(CacheServerSSLConnectionDUnit.class, "doServerRegionTestTask");
- fail("Test should fail as ssl client with wrong config(SslRequireAuth=false) is tryting to connect to server configured with (SslRequireAuth=true)");
+ fail("Test should fail as ssl client with ssl enabled is trying to connect to server with ssl disabled");
}catch (Exception rmiException) {
//ignore
@@ -631,6 +665,8 @@ public class CacheServerSSLConnectionDUnit extends DistributedTestCase {
fail("Unexpected Exception...expected "
+ AuthenticationRequiredException.class);
}*/
+ } finally {
+ expect.remove();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/47ad35dc/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/cacheserver.cer
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/cacheserver.cer b/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/cacheserver.cer
new file mode 100644
index 0000000..3c6645e
Binary files /dev/null and b/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/cacheserver.cer differ
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/47ad35dc/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/cacheserver.keystore
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/cacheserver.keystore b/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/cacheserver.keystore
new file mode 100644
index 0000000..adbea7b
Binary files /dev/null and b/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/cacheserver.keystore differ
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/47ad35dc/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/cacheserver.truststore
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/cacheserver.truststore b/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/cacheserver.truststore
new file mode 100644
index 0000000..3920963
Binary files /dev/null and b/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/cacheserver.truststore differ
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/47ad35dc/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/client.cer
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/client.cer b/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/client.cer
new file mode 100644
index 0000000..35b64af
Binary files /dev/null and b/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/client.cer differ
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/47ad35dc/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/client.keystore
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/client.keystore b/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/client.keystore
new file mode 100644
index 0000000..38a315d
Binary files /dev/null and b/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/client.keystore differ
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/47ad35dc/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/client.truststore
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/client.truststore b/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/client.truststore
new file mode 100644
index 0000000..d598b86
Binary files /dev/null and b/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/client.truststore differ
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/47ad35dc/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/trusted.keystore
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/trusted.keystore b/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/trusted.keystore
new file mode 100644
index 0000000..e8fd92e
Binary files /dev/null and b/gemfire-core/src/test/resources/com/gemstone/gemfire/cache/client/internal/trusted.keystore differ