Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved]Error Regarding QSslSocket
QtWS25 Last Chance

[Solved]Error Regarding QSslSocket

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 25.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zain
    wrote on 5 Jan 2013, 11:39 last edited by
    #1

    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_error

    Below 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

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on 5 Jan 2013, 11:56 last edited by
      #2

      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.

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        Zain
        wrote on 5 Jan 2013, 11:58 last edited by
        #3

        Hello Krzysztof Kawa,

        Thanks for the reply.

        I already installed the openssl 32 bit version on my computer, but nothing happens.

        Also I added ssleay32.dll and other dll's on below path :

        C:\Qt\4.8.4\bin

        Thanks for your efforts.

        Zain

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on 5 Jan 2013, 12:04 last edited by
          #4

          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?

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            Zain
            wrote on 5 Jan 2013, 12:11 last edited by
            #5

            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

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on 5 Jan 2013, 12:22 last edited by
              #6

              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>

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                Zain
                wrote on 5 Jan 2013, 12:33 last edited by
                #7

                Thanks Krzysztof, it works like a charm.

                Thank you very much, I really appreciate your help :-)

                Zain

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  Chris Kawa
                  Lifetime Qt Champion
                  wrote on 5 Jan 2013, 12:36 last edited by
                  #8

                  Glad I could help.
                  Please prepend [SOLVED] to the thread title to let others know there's an answer here.

                  1 Reply Last reply
                  0

                  7/8

                  5 Jan 2013, 12:33

                  • Login

                  • Login or register to search.
                  7 out of 8
                  • First post
                    7/8
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved