diff options
author | Mark Spruiell <mes@zeroc.com> | 2011-11-07 11:11:09 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2011-11-07 11:11:09 -0800 |
commit | 921b615445cbf17139a95d5b8a6e69431898c516 (patch) | |
tree | 85f1804f1a1b5acfbf8ea4e31c2be7dd85a91c50 /java/test/IceSSL/configuration/AllTests.java | |
parent | ICE-4716 - Fixing IceSSL bug for C# (diff) | |
download | ice-921b615445cbf17139a95d5b8a6e69431898c516.tar.bz2 ice-921b615445cbf17139a95d5b8a6e69431898c516.tar.xz ice-921b615445cbf17139a95d5b8a6e69431898c516.zip |
ICE-4717 - IceSSL.Alias property not working
Diffstat (limited to 'java/test/IceSSL/configuration/AllTests.java')
-rw-r--r-- | java/test/IceSSL/configuration/AllTests.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/java/test/IceSSL/configuration/AllTests.java b/java/test/IceSSL/configuration/AllTests.java index 7e515257d15..d5e4e7a1090 100644 --- a/java/test/IceSSL/configuration/AllTests.java +++ b/java/test/IceSSL/configuration/AllTests.java @@ -1133,6 +1133,40 @@ public class AllTests fact.destroyServer(server); comm.destroy(); } + { + // + // Configure the server with both RSA and DSA certificates, but use the + // Alias property to select the DSA certificate. This should succeed. + // + Ice.InitializationData initData = createClientProps(defaultProperties, defaultDir, defaultHost); + initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks"); + Ice.Communicator comm = Ice.Util.initialize(args, initData); + ServerFactoryPrx fact = ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef)); + test(fact != null); + java.util.Map<String, String> d = createServerProps(defaultProperties, defaultDir, defaultHost); + d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks"); + d.put("IceSSL.Alias", "dsacert"); + d.put("IceSSL.Password", "password"); + d.put("IceSSL.Truststore", "cacert1.jks"); + d.put("IceSSL.VerifyPeer", "1"); + ServerPrx server = fact.createServer(d); + try + { + server.ice_ping(); + // + // RSA is used by default, so we examine the negotiated cipher to determine whether + // DSA was actually used. + // + IceSSL.ConnectionInfo info = (IceSSL.ConnectionInfo)server.ice_getConnection().getInfo(); + test(info.cipher.toLowerCase().contains("dss")); + } + catch(Ice.LocalException ex) + { + test(false); + } + fact.destroyServer(server); + comm.destroy(); + } out.println("ok"); out.print("testing IceSSL.TrustOnly... "); |