From c56f8ab6ca6ca0bdb9536fcce1ef24f1ef40ddc7 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Mon, 27 Jun 2016 17:54:30 +0200 Subject: Refactored SSL and iAP transports, support for running SSL on top of TCP/iAP/Bluetooth. --- cpp/test/IceSSL/configuration/Client.cpp | 37 ++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'cpp/test/IceSSL/configuration/Client.cpp') diff --git a/cpp/test/IceSSL/configuration/Client.cpp b/cpp/test/IceSSL/configuration/Client.cpp index 14538e7beac..68d3ad936e1 100644 --- a/cpp/test/IceSSL/configuration/Client.cpp +++ b/cpp/test/IceSSL/configuration/Client.cpp @@ -9,26 +9,51 @@ #include #include +#include +#include + +DEFINE_TEST("client") using namespace std; int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { + string testdir; +#if TARGET_OS_IPHONE == 0 if(argc < 2) { cerr << "Usage: " << argv[0] << " testdir" << endl; return 1; } + testdir = argv[1]; +#endif - void allTests(const Ice::CommunicatorPtr&, const string&, bool, bool); - - cerr << "testing with PKCS12 certificates..." << endl; - allTests(communicator, argv[1], true, false); - cerr << "testing with PEM certificates..." << endl; - allTests(communicator, argv[1], false, true); + Test::ServerFactoryPrxPtr allTests(const Ice::CommunicatorPtr&, const string&, bool); + try + { + cerr << "testing with PKCS12 certificates..." << endl; + Test::ServerFactoryPrxPtr factory = allTests(communicator, testdir, true); +#if !defined(__APPLE__) || TARGET_OS_IPHONE == 0 + cerr << "testing with PEM certificates..." << endl; + factory = allTests(communicator, testdir, false); +#endif + if(factory) + { + factory->shutdown(); + } + } + catch(const IceSSL::CertificateReadException& ex) + { + cout << "couldn't read certificate: " << ex.reason << endl; + } + catch(const std::exception& ex) + { + cout << "unexpected exception: " << ex.what() << endl; + } return EXIT_SUCCESS; + } int -- cgit v1.2.3