Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

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

    General and Desktop
    2
    8
    169
    Loading More Posts
    • 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
      nerdman last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • N
          nerdman @SGaist last edited by

          @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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 0
            • N
              nerdman @SGaist last edited by

              @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 Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 Reply Quote 0
                • N
                  nerdman @SGaist last edited by

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

                  N 1 Reply Last reply Reply Quote 0
                  • N
                    nerdman @nerdman last edited by

                    @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 Reply Quote 0
                    • First post
                      Last post