summaryrefslogtreecommitdiffstats
path: root/src/network/ssl
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-05-06 12:31:49 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-05-07 08:58:53 (GMT)
commit846f47d0fa98942e6df22cd7b6dbf594aaf116f5 (patch)
treef2459b5ac9762e4d940ce8d8ef24199114191e5b /src/network/ssl
parent03b29811a3a6eb34421c476d829075505aa42ada (diff)
downloadQt-846f47d0fa98942e6df22cd7b6dbf594aaf116f5.zip
Qt-846f47d0fa98942e6df22cd7b6dbf594aaf116f5.tar.gz
Qt-846f47d0fa98942e6df22cd7b6dbf594aaf116f5.tar.bz2
Fix OpenSSL dynamic loading on OpenBSD.
OpenBSD's OpenSSL libraries are linked in a bizarre way: libssl.so doesn't link to libcrypto.so, even though it depends on it. I don't claim to understand why, but they do it. So make sure we export its symbols for libssl to see and we load libcrypto first. Task-number: 252042 Patch by: Marc Espie <espie@openbsd.org> Reviewed-by: Peter Hartmann
Diffstat (limited to 'src/network/ssl')
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index e09e764..42c09f5 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -364,11 +364,14 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
// DT_RPATH tags on our library header as well as other system-specific search
// paths. See the man page for dlopen(3) on your system for more information.
+#ifdef Q_OS_OPENBSD
+ libcrypto->setLoadHints(QLibrary::ExportExternalSymbolsHint);
+#endif
#ifdef SHLIB_VERSION_NUMBER
// first attempt: the canonical name is libssl.so.<SHLIB_VERSION_NUMBER>
libssl->setFileNameAndVersion(QLatin1String("ssl"), QLatin1String(SHLIB_VERSION_NUMBER));
libcrypto->setFileNameAndVersion(QLatin1String("crypto"), QLatin1String(SHLIB_VERSION_NUMBER));
- if (libssl->load() && libcrypto->load()) {
+ if (libcrypto->load() && libssl->load()) {
// libssl.so.<SHLIB_VERSION_NUMBER> and libcrypto.so.<SHLIB_VERSION_NUMBER> found
return pair;
} else {
@@ -380,7 +383,7 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
// second attempt: find the development files libssl.so and libcrypto.so
libssl->setFileNameAndVersion(QLatin1String("ssl"), -1);
libcrypto->setFileNameAndVersion(QLatin1String("crypto"), -1);
- if (libssl->load() && libcrypto->load()) {
+ if (libcrypto->load() && libssl->load()) {
// libssl.so.0 and libcrypto.so.0 found
return pair;
} else {
@@ -395,7 +398,7 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
crypto.replace(QLatin1String("ssl"), QLatin1String("crypto"));
libssl->setFileNameAndVersion(ssl, -1);
libcrypto->setFileNameAndVersion(crypto, -1);
- if (libssl->load() && libcrypto->load()) {
+ if (libcrypto->load() && libssl->load()) {
// libssl.so.0 and libcrypto.so.0 found
return pair;
} else {