summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ContextOpenSSLClient.cpp
diff options
context:
space:
mode:
authorAnthony Neal <aneal@zeroc.com>2002-03-18 17:51:29 +0000
committerAnthony Neal <aneal@zeroc.com>2002-03-18 17:51:29 +0000
commit0e943ab6c7159ac053a9d4da4ff6ac37c801ff38 (patch)
tree07b6189539cfd40c9c6bbf579d0e4b0bb205dbe3 /cpp/src/Ice/ContextOpenSSLClient.cpp
parentbug fix: create copy of Identity (diff)
downloadice-0e943ab6c7159ac053a9d4da4ff6ac37c801ff38.tar.bz2
ice-0e943ab6c7159ac053a9d4da4ff6ac37c801ff38.tar.xz
ice-0e943ab6c7159ac053a9d4da4ff6ac37c801ff38.zip
Renamed all the Ssl* files. Modified the config/TestUtil.py file to include
a clientServerHybridTest - handles the test case that client and server are BOTH client and server roles.
Diffstat (limited to 'cpp/src/Ice/ContextOpenSSLClient.cpp')
-rw-r--r--cpp/src/Ice/ContextOpenSSLClient.cpp86
1 files changed, 86 insertions, 0 deletions
diff --git a/cpp/src/Ice/ContextOpenSSLClient.cpp b/cpp/src/Ice/ContextOpenSSLClient.cpp
new file mode 100644
index 00000000000..50f75ce73b2
--- /dev/null
+++ b/cpp/src/Ice/ContextOpenSSLClient.cpp
@@ -0,0 +1,86 @@
+// **********************************************************************
+//
+// Copyright (c) 2002
+// MutableRealms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#include <Ice/SslException.h>
+#include <Ice/SslConnectionOpenSSL.h>
+#include <Ice/ContextOpenSSLClient.h>
+#include <Ice/SslConnectionOpenSSLClient.h>
+
+#include <Ice/TraceLevels.h>
+#include <Ice/Logger.h>
+
+#include <iostream>
+
+using IceSSL::ConnectionPtr;
+using IceSSL::SystemInternalPtr;
+
+void
+IceSSL::OpenSSL::ClientContext::configure(const GeneralConfig& generalConfig,
+ const CertificateAuthority& certificateAuthority,
+ const BaseCertificates& baseCertificates)
+{
+ Context::configure(generalConfig, certificateAuthority, baseCertificates);
+
+ loadCertificateAuthority(certificateAuthority);
+
+ if (_traceLevels->security >= IceSSL::SECURITY_PROTOCOL)
+ {
+ std::ostringstream s;
+
+ s << std::endl;
+ s << "General Configuration - Client" << std::endl;
+ s << "------------------------------" << std::endl;
+ s << generalConfig << std::endl << std::endl;
+
+ s << "Certificate Authority - Client" << std::endl;
+ s << "------------------------------" << std::endl;
+ s << "File: " << certificateAuthority.getCAFileName() << std::endl;
+ s << "Path: " << certificateAuthority.getCAPath() << std::endl;
+
+ s << "Base Certificates - Client" << std::endl;
+ s << "--------------------------" << std::endl;
+ s << baseCertificates << std::endl;
+
+ _logger->trace(_traceLevels->securityCat, s.str());
+ }
+}
+
+IceSSL::ConnectionPtr
+IceSSL::OpenSSL::ClientContext::createConnection(int socket, const SystemInternalPtr& system)
+{
+ if (_sslContext == 0)
+ {
+ IceSSL::OpenSSL::ContextNotConfiguredException contextEx(__FILE__, __LINE__);
+
+ throw contextEx;
+ }
+
+ ConnectionPtr connection = new ClientConnection(_traceLevels,
+ _logger,
+ _certificateVerifier,
+ createSSLConnection(socket),
+ system);
+
+ connectionSetup(connection);
+
+ return connection;
+}
+
+IceSSL::OpenSSL::ClientContext::ClientContext(const IceInternal::InstancePtr& instance) :
+ Context(instance)
+{
+ _rsaPrivateKeyProperty = "Ice.SSL.Client.Overrides.RSA.PrivateKey";
+ _rsaPublicKeyProperty = "Ice.SSL.Client.Overrides.RSA.Certificate";
+ _dsaPrivateKeyProperty = "Ice.SSL.Client.Overrides.DSA.PrivateKey";
+ _dsaPublicKeyProperty = "Ice.SSL.Client.Overrides.DSA.Certificate";
+ _caCertificateProperty = "Ice.SSL.Client.Overrides.CACertificate";
+ _handshakeTimeoutProperty = "Ice.SSL.Client.Handshake.ReadTimeout";
+}
+