summaryrefslogtreecommitdiff
path: root/java/test/IceSSL/configuration/AllTests.java
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2009-01-02 17:37:26 -0800
committerMark Spruiell <mes@zeroc.com>2009-01-02 17:37:26 -0800
commit111ebea1d0f47544d43c7443c4cf745dde8c6c9a (patch)
treed9455059336b3cfc16cd3ab420e43e8d977b5bc4 /java/test/IceSSL/configuration/AllTests.java
parentbug 3464 - IceSSL.CheckCertName property had no effect in C++ (diff)
downloadice-111ebea1d0f47544d43c7443c4cf745dde8c6c9a.tar.bz2
ice-111ebea1d0f47544d43c7443c4cf745dde8c6c9a.tar.xz
ice-111ebea1d0f47544d43c7443c4cf745dde8c6c9a.zip
bug 3464 - correct the Java behavior of IceSSL.CheckCertName
Diffstat (limited to 'java/test/IceSSL/configuration/AllTests.java')
-rw-r--r--java/test/IceSSL/configuration/AllTests.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/java/test/IceSSL/configuration/AllTests.java b/java/test/IceSSL/configuration/AllTests.java
index d6470f9e85c..2012b877641 100644
--- a/java/test/IceSSL/configuration/AllTests.java
+++ b/java/test/IceSSL/configuration/AllTests.java
@@ -424,6 +424,39 @@ public class AllTests
}
fact.destroyServer(server);
comm.destroy();
+
+ //
+ // Test IceSSL.CheckCertName. The test certificate for the server contains "server"
+ // and "127.0.0.1" in its subjectAltName, so we only perform this test when the
+ // default host is "127.0.0.1".
+ //
+ if(defaultHost.equals("127.0.0.1"))
+ {
+ initData = createClientProps(defaultProperties, defaultDir, defaultHost);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ initData.properties.setProperty("IceSSL.CheckCertName", "1");
+ comm = Ice.Util.initialize(args, initData);
+
+ fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ d = createServerProps(defaultProperties, defaultDir, defaultHost);
+ d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
}
System.out.println("ok");