Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QSslSocket HostNotFoundError QT 5.13
QtWS25 Last Chance

QSslSocket HostNotFoundError QT 5.13

Scheduled Pinned Locked Moved Solved Installation and Deployment
qsslsockethostnotfounderrqt 5.13.0linux mint
16 Posts 3 Posters 1.7k 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.
  • T Offline
    T Offline
    Tomaz
    wrote on 11 Jul 2020, 17:54 last edited by Tomaz 7 Nov 2020, 17:54
    #1

    I developed small Qt App for sending mails over smtp 465 port. It works on my developer linux mint 19.2 machine. When I deploy the app with all the libs to Mint 17.3 machine I get QAbstractSocketError::HostNotFoundError. I am using QSslSocket.

    If I deploy my app and libs to another linux mint 19.2 machine it works without any problems. So the problem is the difference in mint 19.2 and 17.3. I exhausted all my possibilities/ideas.

    p.s.
    The OpenSsl is the same installed on both machines! QSslSocket::sslLibraryBuildVersionString() shows 1.1.1b OpenSsl version- the same as installed on deploying machine.

    1 Reply Last reply
    0
    • T Tomaz
      18 Jul 2020, 14:23

      Huh it turn out that on deployed machine the openssl version must be the same as on developing machine in qts folder. That in my case 1.1.1b. So if deploying machine has diffrent version of openssl istalled you have to move some so.1.1 files like ssl, dns, crypto and some other files into deployed machine lib folder or aside elf/app executable. Strace did help. Thank you.

      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 18 Jul 2020, 15:19 last edited by
      #16

      @Tomaz if your issue is solved now, please don't forget to mark your post as such!

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 11 Jul 2020, 18:39 last edited by
        #2

        Hi and welcome to devnet,

        Might be a silly question, but are you sure you can access the server from that specific machine ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • T Offline
          T Offline
          Tomaz
          wrote on 12 Jul 2020, 06:32 last edited by
          #3

          @Tomaz said in QSslSocket HostNotFoundError QT 5.13:

          deploy my app and li

          Yes. Thunderbird works with the same settings. With thunderbird I can send and receive mails on the same server.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 12 Jul 2020, 17:31 last edited by
            #4

            Are you also using the same version of Qt on both machines ?
            Are you using the one provided by the distribution ?
            If not, please try this one.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • T Offline
              T Offline
              Tomaz
              wrote on 12 Jul 2020, 20:30 last edited by Tomaz 7 Dec 2020, 20:31
              #5

              On deploying machine is no Qt framework installed. All libs come with the app elf file (deployed with linuxdeployqt). There is also another glibc loader so elf file is not running- loading- I provided newer loader from mint 19.2 and patched elf file with patchelf app to run the app on mint 17.3 machine. Everything works except part of my app sending mails. Deploying machine is minimalistic only things needed are installed. Mint 17.3 is used because the machine is to slow for newer mint versions. If I deploy the app with libs on the same machine mint 19.2 installed (and running slow) and no Qt framework installed everything works fine. So there is some kind of a problem between mint 17.3 and 19.2. I tried everything...have no idea anymore...

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 13 Jul 2020, 19:36 last edited by
                #6

                Looks like your are using some convoluted way to deploy your application.

                Can you give more detail ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  Tomaz
                  wrote on 13 Jul 2020, 21:46 last edited by
                  #7

                  Well, I use linuxdeployqt app to change the path to needed dynamical linked files or dependency .so files to my lib folder. Thats all. And it works. Second I use patchelf app to change the loader for my app. So I copy my loader from mint 19.2 because at compile time my app links to newer loader that comes with mint 19.2. I am compiling on machine with mint 19.2 installed- I just copy the loader beside my app and change the elf loader (found in /lib/x86_64-linux-gnu/) with patchelf to use my loader from mint 19.2. ld or loader manuall page states that the loader is a portable file and it is encouraging to move the loader beside the elf or app file! My app runs with no problems on mint 17.3 with loader from mint 19.2. Thats it. Now I am asking myself if there is a problem with different glibc files (standard C library - mallock, alock,..etc). Perhaps (after almost every linux app links against glibc) there could be a problem with functions in glibc that differ from mint 17.3 to mint 19.2 when the qabstractsocket/QSslSocket is used/methods called? Does this class uses functions from glibc when the hostlookup is done?

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 14 Jul 2020, 19:17 last edited by
                    #8

                    Is OpenSSL also included along your deployed app ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      Tomaz
                      wrote on 14 Jul 2020, 20:20 last edited by Tomaz
                      #9

                      In previus answer I forgot to write that deployed glibc.so.6 in lib folder shows dependency to local ld or loader on deployed machine that differs from loader on my development machine. I did change that but it didnt help. Yes... I am suspecting also OpenSSL. But I do not know wich files or .so I have to put beside my elf/app file. Installed version on deployed machine is the same as the method QSslSocket::sslLibraryBuildVersionString() is showing or Qt is compiling against- 1.1.1b OpenSsl version. Could it be that my executable is looking for .so or OpenSsl files in some Qt folder on deployed machine? And those folders and files do not exists?

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 15 Jul 2020, 20:20 last edited by
                        #10

                        Did you check with ldd if everything can load ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        1
                        • T Offline
                          T Offline
                          Tomaz
                          wrote on 15 Jul 2020, 20:51 last edited by
                          #11

                          Hi. First, thanks for helping me out! Yes ldd shows everything is loading. Output of ldd is:

                          tomaz@tomaz-HP-350-G1:~/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release$ ldd mail
                          linux-vdso.so.1 (0x00007fff70180000)
                          libQt5Widgets.so.5 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libQt5Widgets.so.5 (0x00007fc18794f000)
                          libQt5Network.so.5 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libQt5Network.so.5 (0x00007fc18759f000)
                          libQt5Core.so.5 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libQt5Core.so.5 (0x00007fc186df2000)
                          libstdc++.so.6 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libstdc++.so.6 (0x00007fc186a27000)
                          libgcc_s.so.1 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libgcc_s.so.1 (0x00007fc18680e000)
                          libc.so.6 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libc.so.6 (0x00007fc186416000)
                          libQt5Gui.so.5 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libQt5Gui.so.5 (0x00007fc185bc9000)
                          libpthread.so.0 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libpthread.so.0 (0x00007fc1859a8000)
                          libGL.so.1 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libGL.so.1 (0x00007fc18570a000)
                          libm.so.6 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libm.so.6 (0x00007fc185369000)
                          libz.so.1 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libz.so.1 (0x00007fc18514b000)
                          libdl.so.2 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libdl.so.2 (0x00007fc184f46000)
                          libicui18n.so.56 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libicui18n.so.56 (0x00007fc184aad000)
                          libicuuc.so.56 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libicuuc.so.56 (0x00007fc1846f5000)
                          libicudata.so.56 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libicudata.so.56 (0x00007fc182d12000)
                          libgthread-2.0.so.0 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libgthread-2.0.so.0 (0x00007fc182b0f000)
                          libglib-2.0.so.0 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libglib-2.0.so.0 (0x00007fc1827ee000)
                          ld-2.27.so => /lib64/ld-linux-x86-64.so.2 (0x00007fc1883b0000)
                          libGLX.so.0 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libGLX.so.0 (0x00007fc1825bc000)
                          libGLdispatch.so.0 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libGLdispatch.so.0 (0x00007fc182305000)
                          libpcre.so.3 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libpcre.so.3 (0x00007fc182092000)
                          libX11.so.6 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libX11.so.6 (0x00007fc181d54000)
                          libxcb.so.1 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libxcb.so.1 (0x00007fc181b27000)
                          libXau.so.6 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libXau.so.6 (0x00007fc181922000)
                          libXdmcp.so.6 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libXdmcp.so.6 (0x00007fc18171b000)
                          libbsd.so.0 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/libbsd.so.0 (0x00007fc181505000)
                          librt.so.1 => /home/tomaz/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release/./lib/librt.so.1 (0x00007fc1812fc000)
                          tomaz@tomaz-HP-350-G1:~/QtProjekti/build-mail-Desktop_Qt_5_13_0_GCC_64bit-Release$

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 16 Jul 2020, 17:54 last edited by
                            #12

                            Next I would go with strace, OpenSSL is not linked by default but dlopened so it won't appear using ldd.

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            T 1 Reply Last reply 17 Jul 2020, 20:12
                            0
                            • S SGaist
                              16 Jul 2020, 17:54

                              Next I would go with strace, OpenSSL is not linked by default but dlopened so it won't appear using ldd.

                              T Offline
                              T Offline
                              Tomaz
                              wrote on 17 Jul 2020, 20:12 last edited by Tomaz
                              #13

                              I tried strace. In did there were some ssl files missing. I copied them to my lib folder after strace showed my app searched for them in lib folder. It didnt helped. Now...after it didnt resolved dns and strace shows that app or sslsocket opens etc/hosts file to resolve domain name I just added ip and domain name of smtp server. And now it works. So my app resolves domain from my hosts file. Strange. I cant understand why it dint resolve smtp name from outer dns server? Do you have any explanation?

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on 17 Jul 2020, 20:19 last edited by
                                #14

                                Nice !

                                That's a good question that I currently do not have an answer for, sorry. Maybe the folks from the linuxdeployqt project might have an idea.

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                T 1 Reply Last reply 18 Jul 2020, 14:23
                                0
                                • S SGaist
                                  17 Jul 2020, 20:19

                                  Nice !

                                  That's a good question that I currently do not have an answer for, sorry. Maybe the folks from the linuxdeployqt project might have an idea.

                                  T Offline
                                  T Offline
                                  Tomaz
                                  wrote on 18 Jul 2020, 14:23 last edited by
                                  #15

                                  Huh it turn out that on deployed machine the openssl version must be the same as on developing machine in qts folder. That in my case 1.1.1b. So if deploying machine has diffrent version of openssl istalled you have to move some so.1.1 files like ssl, dns, crypto and some other files into deployed machine lib folder or aside elf/app executable. Strace did help. Thank you.

                                  P 1 Reply Last reply 18 Jul 2020, 15:19
                                  0
                                  • T Tomaz
                                    18 Jul 2020, 14:23

                                    Huh it turn out that on deployed machine the openssl version must be the same as on developing machine in qts folder. That in my case 1.1.1b. So if deploying machine has diffrent version of openssl istalled you have to move some so.1.1 files like ssl, dns, crypto and some other files into deployed machine lib folder or aside elf/app executable. Strace did help. Thank you.

                                    P Offline
                                    P Offline
                                    Pablo J. Rogina
                                    wrote on 18 Jul 2020, 15:19 last edited by
                                    #16

                                    @Tomaz if your issue is solved now, please don't forget to mark your post as such!

                                    Upvote the answer(s) that helped you solve the issue
                                    Use "Topic Tools" button to mark your post as Solved
                                    Add screenshots via postimage.org
                                    Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                                    1 Reply Last reply
                                    0

                                    1/16

                                    11 Jul 2020, 17:54

                                    • Login

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