summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAnthony Neal <aneal@zeroc.com>2002-05-02 17:33:27 +0000
committerAnthony Neal <aneal@zeroc.com>2002-05-02 17:33:27 +0000
commitd71349bc8be595183c00bd04b2df17fc35c2351b (patch)
treecc86863a211516e1455a247951fca1f67632c14c /cpp
parentAdded Freeze::Evictor::hasObject. (diff)
downloadice-d71349bc8be595183c00bd04b2df17fc35c2351b.tar.bz2
ice-d71349bc8be595183c00bd04b2df17fc35c2351b.tar.xz
ice-d71349bc8be595183c00bd04b2df17fc35c2351b.zip
Added support for IceSSL.
Diffstat (limited to 'cpp')
-rw-r--r--cpp/demo/Glacier/session/Client.cpp24
-rw-r--r--cpp/demo/Glacier/session/Makefile2
2 files changed, 25 insertions, 1 deletions
diff --git a/cpp/demo/Glacier/session/Client.cpp b/cpp/demo/Glacier/session/Client.cpp
index feaa2beefa5..163ef3033a1 100644
--- a/cpp/demo/Glacier/session/Client.cpp
+++ b/cpp/demo/Glacier/session/Client.cpp
@@ -11,6 +11,7 @@
#include <Ice/Ice.h>
#include <Glacier/Glacier.h>
#include <Glacier/Router.h>
+#include <IceSSL/Plugin.h>
#include <HelloSession.h>
@@ -83,6 +84,29 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
}
break;
}
+
+ //
+ // Required in order to activate the trust relationship with
+ // the glacier router.
+ //
+
+ //
+ // Get the SSL plugin.
+ //
+ Ice::PluginManagerPtr pluginManager = communicator->getPluginManager();
+ Ice::PluginPtr plugin = pluginManager->getPlugin("IceSSL");
+ IceSSL::PluginPtr sslPlugin = IceSSL::PluginPtr::dynamicCast(plugin);
+ assert(sslPlugin);
+
+ // Configure the client context of the IceSSL Plugin
+ sslPlugin->configure(IceSSL::Client);
+
+ // Trust only the router certificate, no other certificate.
+ sslPlugin->addTrustedCertificate(IceSSL::Client, routerCert);
+ sslPlugin->setCertificateVerifier(IceSSL::Client, sslPlugin->getSingleCertVerifier(routerCert));
+
+ // Set the public and private keys that the Router will accept.
+ sslPlugin->setRSAKeys(IceSSL::Client, privateKey, publicKey);
communicator->setDefaultRouter(router);
diff --git a/cpp/demo/Glacier/session/Makefile b/cpp/demo/Glacier/session/Makefile
index 7aa21b99c61..0ec8f54621a 100644
--- a/cpp/demo/Glacier/session/Makefile
+++ b/cpp/demo/Glacier/session/Makefile
@@ -33,7 +33,7 @@ SLICECMD = $(SLICE2CPP) -I$(slicedir)
$(CLIENT): $(OBJS) $(COBJS)
rm -f $@
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) -lGlacier $(LIBS)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) -lGlacier $(SSLLIBS) $(LIBS)
$(SERVER): $(OBJS) $(SOBJS)
rm -f $@