New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qt5 has no SSL/TLS support #93
Comments
this path fixes the ssl issue diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index 82ff5e9e..08cb7ab4 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -65,7 +65,7 @@
#include <QtCore/qmutex.h>
#include <private/qmutexpool_p.h>
#include <QtCore/qdatetime.h>
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIXLIKE)
#include <QtCore/qdir.h>
#endif
#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
@@ -541,10 +541,17 @@ DEFINEFUNC5(int, PKCS12_parse, PKCS12 *p12, p12, const char *pass, pass, EVP_PKE
DEFINEFUNC2(PKCS12 *, d2i_PKCS12_bio, BIO *bio, bio, PKCS12 **pkcs12, pkcs12, return 0, return);
DEFINEFUNC(void, PKCS12_free, PKCS12 *pkcs12, pkcs12, return, DUMMYARG)
+#ifdef Q_OS_OS2
+#define RESOLVEFUNC(func) \
+ if (!(_q_##func = _q_PTR_##func(libs.first->resolve("_"#func))) \
+ && !(_q_##func = _q_PTR_##func(libs.second->resolve("_"#func)))) \
+ qsslSocketCannotResolveSymbolWarning(#func);
+#else
#define RESOLVEFUNC(func) \
if (!(_q_##func = _q_PTR_##func(libs.first->resolve(#func))) \
&& !(_q_##func = _q_PTR_##func(libs.second->resolve(#func)))) \
qsslSocketCannotResolveSymbolWarning(#func);
+#endif
#if !defined QT_LINKED_OPENSSL
@@ -559,7 +566,7 @@ bool q_resolveOpenSslSymbols()
}
#else
-# ifdef Q_OS_UNIX
+# if defined(Q_OS_UNIXLIKE)
struct NumericallyLess
{
typedef bool result_type;
@@ -632,6 +639,9 @@ static QStringList libraryPathList()
paths = QString::fromLatin1(qgetenv("LD_LIBRARY_PATH"))
.split(QLatin1Char(':'), QString::SkipEmptyParts);
# endif
+#ifdef Q_OS_OS2
+ paths << QLatin1String("/@unixroot/usr/lib") << QLatin1String("/@unixroot/usr/local/lib");
+#endif
paths << QLatin1String("/lib") << QLatin1String("/usr/lib") << QLatin1String("/usr/local/lib");
paths << QLatin1String("/lib64") << QLatin1String("/usr/lib64") << QLatin1String("/usr/local/lib64");
paths << QLatin1String("/lib32") << QLatin1String("/usr/lib32") << QLatin1String("/usr/local/lib32");
@@ -669,12 +679,20 @@ static QStringList findAllLibs(QLatin1String filter)
static QStringList findAllLibSsl()
{
+#ifdef Q_OS_OS2
+ return findAllLibs(QLatin1String("ssl*.dll"));
+#else
return findAllLibs(QLatin1String("libssl.*"));
+#endif
}
static QStringList findAllLibCrypto()
{
+#ifdef Q_OS_OS2
+ return findAllLibs(QLatin1String("crypto*.dll"));
+#else
return findAllLibs(QLatin1String("libcrypto.*"));
+#endif
}
# endif
@@ -745,7 +763,7 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
{
QPair<QLibrary*,QLibrary*> pair;
-# if defined(Q_OS_UNIX)
+# if defined(Q_OS_UNIXLIKE)
QLibrary *&libssl = pair.first;
QLibrary *&libcrypto = pair.second;
libssl = new QLibrary; but when using the debug build I get the following afterwards: Killed by SIGABRT |
BTW, there is a configure option to link to OpenSSL DLLs statically instead of this dynamic linking: |
@SilvanScherrer's patch committed (with slight modifications). I also tested |
When running the examples from the QT5 ports, i notice that there is no support for SSL/TLS
F:\Qt5-OS2\examples\network\http\release>http.exe
qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
It says we don't have SSL/TLS support (edited)
The text was updated successfully, but these errors were encountered: