[Solved]Error Regarding QSslSocket
-
Hello All,
I am getting below error with my application.
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_errorBelow is the code for which I am getting above error:
@ postData.append(postString);
req.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
manager->setCookieJar(new QNetworkCookieJar(manager));
reply = manager->post(req, postData);
connect(reply, SIGNAL(finished()), this, SLOT(replyFinish1 ()));@These code is working great on my other system where I build the application. But now I install QT on my other system and trying to run these application.
I searched about it on web and found some suggestions, but I know know how to apply these suggestion with my application.
Thanks in advance.
Zain -
You need to deploy openssl libraries with your app. This can be done by putting appropiate dlls (ssleay32.dll and few more) alongside your executable or by installing openssl runtime package (eg. from here: "Link":http://www.openssl.org/related/binaries.html ) on users computer.
-
Well this is clearly the issue with missing openssl libraries. Are you sure that you've got the same openssl libs version as what your app uses? The easiest way to find out would be to explicitly put libeay32.dll and ssleay32.dll in your app executable directory and see if it works.
Also - is your Qt build with openssl support enabled? -
Krzysztof I am really sorry, but I am a newbie in QT and don't know where is my app executable directory, but I have these 2 dll's, but I don't know the path of executable directory.
Also how can I check openssl support is enabled or not.
Thanks again for your great effort.
Zain -
By executable directory I mean the directory where your .exe file is located.
For QtCreator, if you have your source in say C:\MyApp\ this would be by default something like C:\MyApp-build-<name_of_the_kit_used>-Release\release<MyAppName>.exe
For Visual Studio this would be something like C:\MyApp\Release<MyAppName>.exe
When you deploy (give to someone else or move to another machine) your app you need to copy
appropriate file structure like:
MyAppDir/MyApp.exe
MyAppDir/Qt5Core.dll
MyAppDir/Qt5Gui.dll
MyAppDir/platforms/qwindows.dll
MyAppDir/libeay32.dll
MyAppDir/ssleay32.dll
MyAppDir/<other needed dlls> -
Glad I could help.
Please prepend [SOLVED] to the thread title to let others know there's an answer here.