diff options
author | Mark Spruiell <mes@zeroc.com> | 2006-04-26 19:24:34 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2006-04-26 19:24:34 +0000 |
commit | a9a902212890df4820732e4cca37bd34a6cf8eb7 (patch) | |
tree | b6651c490ff4c94fc505604a98219de12d3aa205 /java/test/IceSSL/configuration/ServerI.java | |
parent | adding ConnectionInfo (diff) | |
download | ice-a9a902212890df4820732e4cca37bd34a6cf8eb7.tar.bz2 ice-a9a902212890df4820732e4cca37bd34a6cf8eb7.tar.xz ice-a9a902212890df4820732e4cca37bd34a6cf8eb7.zip |
adding IceSSL.ConnectionInfo
Diffstat (limited to 'java/test/IceSSL/configuration/ServerI.java')
-rw-r--r-- | java/test/IceSSL/configuration/ServerI.java | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/java/test/IceSSL/configuration/ServerI.java b/java/test/IceSSL/configuration/ServerI.java index b600f9c3a3e..d54b9b1d69e 100644 --- a/java/test/IceSSL/configuration/ServerI.java +++ b/java/test/IceSSL/configuration/ServerI.java @@ -15,10 +15,64 @@ class ServerI extends Test._ServerDisp } public void + noCert(Ice.Current current) + { + try + { + IceSSL.ConnectionInfo info = IceSSL.Util.getConnectionInfo(current.con); + test(info.certs == null); + } + catch(IceSSL.ConnectionInvalidException ex) + { + test(false); + } + } + + public void + checkCert(String subjectDN, String issuerDN, Ice.Current current) + { + try + { + IceSSL.ConnectionInfo info = IceSSL.Util.getConnectionInfo(current.con); + java.security.cert.X509Certificate cert = (java.security.cert.X509Certificate)info.certs[0]; + test(info.certs.length == 2 && + cert.getSubjectDN().toString().equals(subjectDN) && + cert.getIssuerDN().toString().equals(issuerDN)); + } + catch(IceSSL.ConnectionInvalidException ex) + { + test(false); + } + } + + public void + checkCipher(String cipher, Ice.Current current) + { + try + { + IceSSL.ConnectionInfo info = IceSSL.Util.getConnectionInfo(current.con); + test(info.cipher.indexOf(cipher) >= 0); + } + catch(IceSSL.ConnectionInvalidException ex) + { + test(false); + } + } + + public void destroy() { _communicator.destroy(); } + private static void + test(boolean b) + { + if(!b) + { + throw new RuntimeException(); + } + } + private Ice.Communicator _communicator; } |