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. Application using OpenSSL 1.1.1d only working if I launch application from QtCreator

Application using OpenSSL 1.1.1d only working if I launch application from QtCreator

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 2 Posters 691 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.
  • N Offline
    N Offline
    nerdman
    wrote on 19 Aug 2020, 16:29 last edited by
    #1

    I am running Linux Mint 18.3 and QtCreator (Qt version 5.15) and developing a C++ GUI application. Because of the openSSL mismatch between Mint repository SSL version and that used by Qt5.12 onwards, I have installed the OpenSSL1.1.1d binaries via the Qt Maintenance Tool and have explicitly added these libraries to my application project.

    Without this step the application does not work (as expected). With this step, my application runs successfully but ONLY when launched WITHIN QtCreator. It does not work when I try running the binary in any other way.

    I know that I must be missing something simple here, but what is QtCreator doing that enables access to SSL?

    I would like to be able to run my application without having to do so inside of QtCreator but so far I can find no workaround to allow this. Can anyone suggest what I am missing?

    I can confirm that the output of calls to my QSslSocket::sslLibraryVersionString() function are returning empty string and "OpenSSL 1.1.1d" respectively, so I am convinced this is a runtime linking problem.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 19 Aug 2020, 16:54 last edited by
      #2

      Hi and welcome to devnet,

      What version does your Mint installation provide ?

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

      N 1 Reply Last reply 19 Aug 2020, 17:17
      0
      • S SGaist
        19 Aug 2020, 16:54

        Hi and welcome to devnet,

        What version does your Mint installation provide ?

        N Offline
        N Offline
        nerdman
        wrote on 19 Aug 2020, 17:17 last edited by
        #3

        @SGaist If I run >openssl version I get this output
        OpenSSL 1.0.2g 1 Mar 2016
        I recently upgraded to 5.15 from 5.9 and because of the change to use SSL 1.1 in Qt 5.12 I had to download the libs in the tools with the maintenance tool.
        It all builds properly and it runs properly inside QtCreator but if I just execute the binary outside of it the SSL is not picked up. I am very confused. If I run one instance inside and another outside I can see from a ps ux that no command line params are being used. Looks like 2 identical instances of the binaries runner.

        Strangely, if I run ldd on my output binary I see no reference to either libssl.so or libcrypto.so despite explicitly adding these to the .pro file.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 19 Aug 2020, 18:01 last edited by
          #4

          Qt does not link to OpenSSL due to export constraints in some countries with regard to cryptographic software. It dlopens the library if you provide them.

          I wonder if using LD_LIBRARY_PATH would be enough in your case.

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

          N 1 Reply Last reply 19 Aug 2020, 18:05
          0
          • S SGaist
            19 Aug 2020, 18:01

            Qt does not link to OpenSSL due to export constraints in some countries with regard to cryptographic software. It dlopens the library if you provide them.

            I wonder if using LD_LIBRARY_PATH would be enough in your case.

            N Offline
            N Offline
            nerdman
            wrote on 19 Aug 2020, 18:05 last edited by
            #5

            @SGaist The paths to these Qt supplied binaries is contained within LD_LIBRARY_PATH for this project. What hidden magic is going on inside QtCreator such that everything works when I launch the binary from there but not elsewhere? I am really confused.

            Is it perhaps a better option to simply build and install openSSL from source so that it matches what Qt5.15 now uses?

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

              Check the Environment in the Run part of the Project panel.

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

              N 1 Reply Last reply 19 Aug 2020, 18:25
              0
              • S SGaist
                19 Aug 2020, 18:19

                Check the Environment in the Run part of the Project panel.

                N Offline
                N Offline
                nerdman
                wrote on 19 Aug 2020, 18:25 last edited by
                #7

                @SGaist Yes LD_LIBRARY_PATH does contain the location of the Qt supplied libs for 1.1.1d.

                N 1 Reply Last reply 19 Aug 2020, 18:47
                0
                • N nerdman
                  19 Aug 2020, 18:25

                  @SGaist Yes LD_LIBRARY_PATH does contain the location of the Qt supplied libs for 1.1.1d.

                  N Offline
                  N Offline
                  nerdman
                  wrote on 19 Aug 2020, 18:47 last edited by
                  #8

                  @nerdman OK I think I know what QtCreator must be doing. If I change LD_LIBRARY_PATH to include the path to Qt supplied SSL libs then run my binary from the console, it DOES now pick this up.
                  I suppose that QtCreator is doing this prior to running the binary when launched from there.

                  It is not an ideal solution but it at least allows me to do what is required. Many thanks @SGaist for your input that has helped me to get to this stage.

                  1 Reply Last reply
                  0

                  1/8

                  19 Aug 2020, 16:29

                  • Login

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