summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAnthony Neal <aneal@zeroc.com>2002-03-25 19:24:16 +0000
committerAnthony Neal <aneal@zeroc.com>2002-03-25 19:24:16 +0000
commitf7f65d1696603ef64422c593f016b654292b388c (patch)
tree4616eee9ed85a84f631443ce3f69b800e0d4c747 /cpp
parentadding support for TIE classes (diff)
downloadice-f7f65d1696603ef64422c593f016b654292b388c.tar.bz2
ice-f7f65d1696603ef64422c593f016b654292b388c.tar.xz
ice-f7f65d1696603ef64422c593f016b654292b388c.zip
Updates to allow test/Glacier/starter to run in non-SSL mode.
Diffstat (limited to 'cpp')
-rw-r--r--cpp/config/TestUtil.py4
-rw-r--r--cpp/src/Glacier/GlacierRouter.cpp55
-rw-r--r--cpp/test/Glacier/starter/Client.cpp28
-rwxr-xr-xcpp/test/Glacier/starter/run.py14
4 files changed, 51 insertions, 50 deletions
diff --git a/cpp/config/TestUtil.py b/cpp/config/TestUtil.py
index b9b80624ffb..b535fe8f9c7 100644
--- a/cpp/config/TestUtil.py
+++ b/cpp/config/TestUtil.py
@@ -50,8 +50,8 @@ else:
commonServerOptions = \
" --Ice.PrintProcessId --Ice.PrintAdapterReady --Ice.ConnectionWarnings --Ice.ServerIdleTime=30"
-serverOptions = commonServerOptions + serverProtocol
-clientOptions = clientProtocol + defaultHost
+serverOptions = commonServerOptions + serverProtocol + "--Ice.Trace.Network=3"
+clientOptions = clientProtocol + defaultHost + "--Ice.Trace.Network=3"
clientServerOptions = commonServerOptions + clientServerProtocol + defaultHost
collocatedOptions = clientServerProtocol
diff --git a/cpp/src/Glacier/GlacierRouter.cpp b/cpp/src/Glacier/GlacierRouter.cpp
index fc7d0aa6bef..7caff20ff3e 100644
--- a/cpp/src/Glacier/GlacierRouter.cpp
+++ b/cpp/src/Glacier/GlacierRouter.cpp
@@ -122,31 +122,38 @@ Glacier::Router::run(int argc, char* argv[])
PropertiesPtr properties = communicator()->getProperties();
- string clientPrivKey = properties->getProperty("Ice.SSL.Client.Overrides.RSA.PrivateKey");
- string clientPubKey = properties->getProperty("Ice.SSL.Client.Overrides.RSA.Certificate");
- string serverPrivKey = properties->getProperty("Ice.SSL.Server.Overrides.RSA.PrivateKey");
- string serverPubKey = properties->getProperty("Ice.SSL.Server.Overrides.RSA.Certificate");
+ string clientConfig = properties->getProperty("Ice.SSL.Client.Config");
+ string serverConfig = properties->getProperty("Ice.SSL.Server.Config");
- IceSSL::ContextType contextType = IceSSL::ClientServer;
-
- // Get our SSL System and an instance of the SSL Extension itself
- IceSSL::SystemPtr sslSystem = communicator()->getSslSystem();
- IceSSL::SslExtensionPtr sslExtension = communicator()->getSslExtension();
-
- // The system must configure itself (using config files as specified)
- sslSystem->configure(contextType);
-
- // Set the keys we will be using.
- sslSystem->setRSAKeysBase64(IceSSL::Client, clientPrivKey, clientPubKey);
- sslSystem->setRSAKeysBase64(IceSSL::Server, serverPrivKey, serverPubKey);
-
- // Install a Certificate Verifier that only accepts the client's certificate.
- string clientCertBase64 = properties->getProperty("Glacier.Router.AcceptCert");
- Ice::ByteSeq clientCert = IceUtil::Base64::decode(clientCertBase64);
- sslSystem->setCertificateVerifier(contextType, sslExtension->getSingleCertVerifier(clientCert));
-
- // Add the Client's certificate as a trusted certificate.
- sslSystem->addTrustedCertificateBase64(contextType, clientCertBase64);
+ // Only do this if we've been configured for SSL
+ if (!clientConfig.empty() && !serverConfig.empty())
+ {
+ string clientPrivKey = properties->getProperty("Ice.SSL.Client.Overrides.RSA.PrivateKey");
+ string clientPubKey = properties->getProperty("Ice.SSL.Client.Overrides.RSA.Certificate");
+ string serverPrivKey = properties->getProperty("Ice.SSL.Server.Overrides.RSA.PrivateKey");
+ string serverPubKey = properties->getProperty("Ice.SSL.Server.Overrides.RSA.Certificate");
+
+ IceSSL::ContextType contextType = IceSSL::ClientServer;
+
+ // Get our SSL System and an instance of the SSL Extension itself
+ IceSSL::SystemPtr sslSystem = communicator()->getSslSystem();
+ IceSSL::SslExtensionPtr sslExtension = communicator()->getSslExtension();
+
+ // The system must configure itself (using config files as specified)
+ sslSystem->configure(contextType);
+
+ // Set the keys we will be using.
+ sslSystem->setRSAKeysBase64(IceSSL::Client, clientPrivKey, clientPubKey);
+ sslSystem->setRSAKeysBase64(IceSSL::Server, serverPrivKey, serverPubKey);
+
+ // Install a Certificate Verifier that only accepts the client's certificate.
+ string clientCertBase64 = properties->getProperty("Glacier.Router.AcceptCert");
+ Ice::ByteSeq clientCert = IceUtil::Base64::decode(clientCertBase64);
+ sslSystem->setCertificateVerifier(contextType, sslExtension->getSingleCertVerifier(clientCert));
+
+ // Add the Client's certificate as a trusted certificate.
+ sslSystem->addTrustedCertificateBase64(contextType, clientCertBase64);
+ }
//
// Create routing table
diff --git a/cpp/test/Glacier/starter/Client.cpp b/cpp/test/Glacier/starter/Client.cpp
index 92b85caa522..73e82038fea 100644
--- a/cpp/test/Glacier/starter/Client.cpp
+++ b/cpp/test/Glacier/starter/Client.cpp
@@ -88,22 +88,28 @@ CallbackClient::run(int argc, char* argv[])
PropertiesPtr properties = communicator()->getProperties();
- string privateKeyBase64 = IceUtil::Base64::encode(privateKey);
- string publicKeyBase64 = IceUtil::Base64::encode(publicKey);
- string routerCertString = IceUtil::Base64::encode(routerCert);
+ string clientConfig = properties->getProperty("Ice.SSL.Client.Config");
+ string serverConfig = properties->getProperty("Ice.SSL.Server.Config");
- IceSSL::SystemPtr sslSystem = communicator()->getSslSystem();
- IceSSL::SslExtensionPtr sslExtension = communicator()->getSslExtension();
+ if (!clientConfig.empty() && !serverConfig.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();
- // Configure Server, client is already configured
- sslSystem->configure(IceSSL::Server);
+ // Configure Server, client is already configured
+ sslSystem->configure(IceSSL::Server);
- sslSystem->setCertificateVerifier(IceSSL::ClientServer, sslExtension->getSingleCertVerifier(routerCert));
+ sslSystem->setCertificateVerifier(IceSSL::ClientServer, sslExtension->getSingleCertVerifier(routerCert));
- // Set the keys overrides.
- sslSystem->setRSAKeysBase64(IceSSL::ClientServer, privateKeyBase64, publicKeyBase64);
+ // Set the keys overrides.
+ sslSystem->setRSAKeysBase64(IceSSL::ClientServer, privateKeyBase64, publicKeyBase64);
- sslSystem->addTrustedCertificateBase64(IceSSL::ClientServer, routerCertString);
+ sslSystem->addTrustedCertificateBase64(IceSSL::ClientServer, routerCertString);
+ }
test(router);
cout << "ok" << endl;
diff --git a/cpp/test/Glacier/starter/run.py b/cpp/test/Glacier/starter/run.py
index 09357804665..2dbca1f396a 100755
--- a/cpp/test/Glacier/starter/run.py
+++ b/cpp/test/Glacier/starter/run.py
@@ -21,10 +21,6 @@ else:
sys.path.append(os.path.join(toplevel, "config"))
import TestUtil
-if TestUtil.protocol != "ssl":
- print "This test may only be run using the SSL protocol."
- sys.exit(0)
-
starter = os.path.join(toplevel, "bin", "glacierstarter")
router = os.path.join(toplevel, "bin", "glacier")
@@ -37,15 +33,7 @@ command = starter + updatedClientServerOptions + \
r' --Glacier.Starter.Endpoints="default -p 12346 -t 5000"' + \
r' --Glacier.Router.Endpoints="default"' + \
r' --Glacier.Client.Endpoints="default"' + \
- r' --Glacier.Server.Endpoints="tcp"' + \
- r' --Glacier.Starter.Certificate.Country=US' + \
- r' --Glacier.Starter.Certificate.StateProvince=Alabama' + \
- r' --Glacier.Starter.Certificate.Locality=Huntsville' + \
- r' --Glacier.Starter.Certificate.Organization="Mutable Realms"' + \
- r' --Glacier.Starter.Certificate.OrganizationalUnit="Ice Age Game"' + \
- r' --Glacier.Starter.Certificate.CommonName="Ice Age Certificate"' + \
- r' --Glacier.Starter.Certificate.BitStrength=1024' + \
- r' --Glacier.Starter.Certificate.SecondsValid=31536000'
+ r' --Glacier.Server.Endpoints="tcp"'
print "starting glacier starter...",
starterPipe = os.popen(command)