summaryrefslogtreecommitdiff
path: root/cpp/src/IceSSL/Instance.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2010-03-17 16:14:39 -0700
committerMark Spruiell <mes@zeroc.com>2010-03-17 16:14:39 -0700
commitab2f99bd618dc5c6a942880e18b8d7f0f536f9f3 (patch)
tree4a080eddd539a68d19bef5dae1c23ac5c3f67e97 /cpp/src/IceSSL/Instance.cpp
parentCleaning up translator and adding tests related to bug 4704. (diff)
downloadice-ab2f99bd618dc5c6a942880e18b8d7f0f536f9f3.tar.bz2
ice-ab2f99bd618dc5c6a942880e18b8d7f0f536f9f3.tar.xz
ice-ab2f99bd618dc5c6a942880e18b8d7f0f536f9f3.zip
bug 4706 - OpenSSL 1.0 compatibility
Diffstat (limited to 'cpp/src/IceSSL/Instance.cpp')
-rw-r--r--cpp/src/IceSSL/Instance.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/cpp/src/IceSSL/Instance.cpp b/cpp/src/IceSSL/Instance.cpp
index 48060b2324c..cefe5f27be8 100644
--- a/cpp/src/IceSSL/Instance.cpp
+++ b/cpp/src/IceSSL/Instance.cpp
@@ -199,6 +199,12 @@ IceSSL::Instance::Instance(const CommunicatorPtr& communicator) :
SSL_library_init();
//
+ // This is necessary to allow programs that use OpenSSL 0.9.x to
+ // load private key files generated by OpenSSL 1.x.
+ //
+ OpenSSL_add_all_algorithms();
+
+ //
// Initialize the PRNG.
//
#ifdef WINDOWS
@@ -291,7 +297,7 @@ IceSSL::Instance::~Instance()
if(--instanceCount == 0)
{
//
- // NOTE: We can't destroy the locks here: threads wich might have called openssl methods
+ // NOTE: We can't destroy the locks here: threads which might have called openssl methods
// might access openssl locks upon termination (from DllMain/THREAD_DETACHED). Instead,
// we release the locks in the ~Init() static destructor. See bug #4156.
//
@@ -1058,7 +1064,13 @@ IceSSL::Instance::traceConnection(SSL* ssl, bool incoming)
{
Trace out(_logger, _securityTraceCategory);
out << "SSL summary for " << (incoming ? "incoming" : "outgoing") << " connection\n";
- SSL_CIPHER* cipher = SSL_get_current_cipher(ssl);
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ const SSL_CIPHER *cipher;
+#else
+ SSL_CIPHER *cipher;
+#endif
+
+ cipher = SSL_get_current_cipher(ssl);
if(!cipher)
{
out << "unknown cipher\n";