summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2012-10-10 12:55:37 (GMT)
committerRemko Tronçon <git@el-tramo.be>2012-10-12 17:07:10 (GMT)
commit3cf3828562d54db0ddaacfcea755b15c5b8c5e90 (patch)
tree6070370e7b867bc3cb47ce2317e46277f93d814d /Swiften/TLS/OpenSSL
parent54deca37412de7bc7b317ac92b4aab1b568eab0d (diff)
downloadswift-3cf3828562d54db0ddaacfcea755b15c5b8c5e90.zip
swift-3cf3828562d54db0ddaacfcea755b15c5b8c5e90.tar.bz2
Always add system's certificate store to OpenSSL on Mac OS X.
It used to be disabled for Mac OS X 10.5 or greater but it turns out system's OpenSSL doesn't add those on Mac OS X 10.8. License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php
Diffstat (limited to 'Swiften/TLS/OpenSSL')
-rw-r--r--Swiften/TLS/OpenSSL/OpenSSLContext.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
index 2364c2e..000e987 100644
--- a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
+++ b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
@@ -15,7 +15,7 @@
#include <openssl/pkcs12.h>
#include <boost/smart_ptr/make_shared.hpp>
-#if defined(SWIFTEN_PLATFORM_MACOSX) && OPENSSL_VERSION_NUMBER < 0x00908000
+#if defined(SWIFTEN_PLATFORM_MACOSX)
#include <Security/Security.h>
#endif
@@ -64,7 +64,8 @@ OpenSSLContext::OpenSSLContext() : state_(Start), context_(0), handle_(0), readB
}
#elif !defined(SWIFTEN_PLATFORM_MACOSX)
SSL_CTX_load_verify_locations(context_, NULL, "/etc/ssl/certs");
-#elif defined(SWIFTEN_PLATFORM_MACOSX) && OPENSSL_VERSION_NUMBER < 0x00908000
+#elif defined(SWIFTEN_PLATFORM_MACOSX)
+ // On Mac OS X 10.8 (OpenSSL 0.9.8r), OpenSSL does not automatically look in the system store.
// On Mac OS X 10.5 (OpenSSL < 0.9.8), OpenSSL does not automatically look in the system store.
// We therefore add all certs from the system store ourselves.
X509_STORE* store = SSL_CTX_get_cert_store(context_);