summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch/Client.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2002-04-24 21:13:00 +0000
committerMark Spruiell <mes@zeroc.com>2002-04-24 21:13:00 +0000
commit5409c1ecef0f226dedc77721c0d2fc8dfe9e85de (patch)
tree97ba75bc47a143726d6d8382be3a462e51716700 /cpp/src/IcePatch/Client.cpp
parentcleaning up sample impls (diff)
downloadice-5409c1ecef0f226dedc77721c0d2fc8dfe9e85de.tar.bz2
ice-5409c1ecef0f226dedc77721c0d2fc8dfe9e85de.tar.xz
ice-5409c1ecef0f226dedc77721c0d2fc8dfe9e85de.zip
merging from plugins branch
Diffstat (limited to 'cpp/src/IcePatch/Client.cpp')
-rw-r--r--cpp/src/IcePatch/Client.cpp36
1 files changed, 25 insertions, 11 deletions
diff --git a/cpp/src/IcePatch/Client.cpp b/cpp/src/IcePatch/Client.cpp
index 3e08de9dee6..d238528e654 100644
--- a/cpp/src/IcePatch/Client.cpp
+++ b/cpp/src/IcePatch/Client.cpp
@@ -13,8 +13,7 @@
#include <IcePatch/Util.h>
#include <Glacier/Glacier.h>
#include <IceUtil/Base64.h>
-#include <Ice/System.h>
-#include <Ice/SslExtension.h>
+#include <IceSSL/Plugin.h>
#include <iomanip>
#ifdef _WIN32
# include <direct.h>
@@ -125,19 +124,21 @@ IcePatch::Client::run(int argc, char* argv[])
}
}
- string clientConfig = properties->getProperty("Ice.SSL.Client.Config");
+ string clientConfig = properties->getProperty("IceSSL.Client.Config");
if (!clientConfig.empty())
{
string privateKeyBase64 = IceUtil::Base64::encode(privateKey);
string publicKeyBase64 = IceUtil::Base64::encode(publicKey);
string routerCertString = IceUtil::Base64::encode(routerCert);
-
- IceSSL::SystemPtr sslSystem = communicator()->getSslSystem();
- IceSSL::SslExtensionPtr sslExtension = communicator()->getSslExtension();
- sslSystem->setCertificateVerifier(IceSSL::Client, sslExtension->getSingleCertVerifier(routerCert));
- sslSystem->setRSAKeysBase64(IceSSL::Client, privateKeyBase64, publicKeyBase64);
- sslSystem->addTrustedCertificateBase64(IceSSL::Client, routerCertString);
+ PluginManagerPtr pluginManager = communicator()->getPluginManager();
+ PluginPtr plugin = pluginManager->getPlugin("IceSSL");
+ IceSSL::PluginPtr sslPlugin = IceSSL::PluginPtr::dynamicCast(plugin);
+ assert(sslPlugin);
+
+ sslPlugin->setCertificateVerifier(IceSSL::Client, sslPlugin->getSingleCertVerifier(routerCert));
+ sslPlugin->setRSAKeysBase64(IceSSL::Client, privateKeyBase64, publicKeyBase64);
+ sslPlugin->addTrustedCertificateBase64(IceSSL::Client, routerCertString);
}
communicator()->setDefaultRouter(router);
@@ -409,8 +410,21 @@ IcePatch::Client::patch(const FileDescSeq& fileDescSeq, const string& indent)
int
main(int argc, char* argv[])
{
- addArgumentPrefix("IcePatch");
- addArgumentPrefix("Glacier");
+ PropertiesPtr defaultProperties;
+ try
+ {
+ defaultProperties = getDefaultProperties(argc, argv);
+ StringSeq args = argsToStringSeq(argc, argv);
+ args = defaultProperties->parseCommandLineOptions("IcePatch", args);
+ args = defaultProperties->parseCommandLineOptions("Glacier", args);
+ stringSeqToArgs(args, argc, argv);
+ }
+ catch(const Exception& ex)
+ {
+ cerr << argv[0] << ": " << ex << endl;
+ return EXIT_FAILURE;
+ }
+
Client app;
return app.main(argc, argv);
}