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. Wrong version of OpenSSL used when deploying application
Forum Updated to NodeBB v4.3 + New Features

Wrong version of OpenSSL used when deploying application

Scheduled Pinned Locked Moved Solved Installation and Deployment
7 Posts 5 Posters 1.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.
  • R Offline
    R Offline
    rctm
    wrote on 11 Aug 2023, 09:29 last edited by rctm 8 Nov 2023, 09:53
    #1

    My Application is running fine when launched from QtCreator, but can't run from console.
    Error when ran from console:

    qt.tlsbackend.ossl: Incompatible version of OpenSSL (built with OpenSSL >= 3.x, runtime version is < 3.x)
    qt.network.ssl: The backend "cert-only" does not support QSslKey
    qt.network.ssl: Active TLS backend does not support key creation
    qt.network.ssl: The backend "cert-only" does not support QSslKey
    qt.network.ssl: Active TLS backend does not support key creation
    qt.network.ssl: The backend "cert-only" does not support QSslKey
    qt.network.ssl: Active TLS backend does not support key creation
    qt.network.ssl: The backend "cert-only" does not support QSslKey
    qt.network.ssl: Active TLS backend does not support key creation
    qt.network.ssl: The backend "cert-only" does not support QSslKey
    qt.network.ssl: Active TLS backend does not support key creation
    qt.network.ssl: The backend "cert-only" does not support QSslKey
    qt.network.ssl: Active TLS backend does not support key creation
    qt.network.ssl: The backend "cert-only" does not support QSslSocket
    qt.network.ssl: The backend named "cert-only" does not support TLS
    qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
    

    .pro file:

        LIBS += -L/usr/local/lib64 -lcrypto  -lssl
    

    ldd application output:

            libcrypto.so.3 => /usr/local/lib64/libcrypto.so.3 (0x00007face2a90000)
            libssl.so.3 => /usr/local/lib64/libssl.so.3 (0x00007face29d9000)
    
    

    How can I tell Qt which library to use when deploying my application?
    OS is debian 9 and OpenSSL 3.2.0-dev is installed.
    QT version is 6.5.2.

    J 1 Reply Last reply 11 Aug 2023, 13:31
    0
    • R rctm
      14 Aug 2023, 11:24

      @Christian-Ehrlicher said in Wrong version of OpenSSL used when deploying application:

      LD_LIBRARY_PATH

      Thank you! I can now run the application from terminal if I add the path of the openssl libs to LD_LIBRARY_PATH.
      Whats weird is that I've already added this path to /etc/ld.so.conf and ran ldconfig, so the path should already be known.

      K Offline
      K Offline
      kkoehne
      Moderators
      wrote on 14 Aug 2023, 13:40 last edited by
      #7

      @rctm When openssl is loaded at runtime, Qt does not use ld. Instead, it checks out directories in LD_LIBRARY_PATH, and some default locations (/lib, /usr/lib , /usr/local/lib , as well the lib32 and lib64variants:

      https://codebrowser.dev/qt5/qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp.html#_ZL15libraryPathListv

      So augmenting /etc/ld.so.conf won't make a difference.

      Director R&D, The Qt Company

      1 Reply Last reply
      2
      • R rctm
        11 Aug 2023, 09:29

        My Application is running fine when launched from QtCreator, but can't run from console.
        Error when ran from console:

        qt.tlsbackend.ossl: Incompatible version of OpenSSL (built with OpenSSL >= 3.x, runtime version is < 3.x)
        qt.network.ssl: The backend "cert-only" does not support QSslKey
        qt.network.ssl: Active TLS backend does not support key creation
        qt.network.ssl: The backend "cert-only" does not support QSslKey
        qt.network.ssl: Active TLS backend does not support key creation
        qt.network.ssl: The backend "cert-only" does not support QSslKey
        qt.network.ssl: Active TLS backend does not support key creation
        qt.network.ssl: The backend "cert-only" does not support QSslKey
        qt.network.ssl: Active TLS backend does not support key creation
        qt.network.ssl: The backend "cert-only" does not support QSslKey
        qt.network.ssl: Active TLS backend does not support key creation
        qt.network.ssl: The backend "cert-only" does not support QSslKey
        qt.network.ssl: Active TLS backend does not support key creation
        qt.network.ssl: The backend "cert-only" does not support QSslSocket
        qt.network.ssl: The backend named "cert-only" does not support TLS
        qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
        

        .pro file:

            LIBS += -L/usr/local/lib64 -lcrypto  -lssl
        

        ldd application output:

                libcrypto.so.3 => /usr/local/lib64/libcrypto.so.3 (0x00007face2a90000)
                libssl.so.3 => /usr/local/lib64/libssl.so.3 (0x00007face29d9000)
        
        

        How can I tell Qt which library to use when deploying my application?
        OS is debian 9 and OpenSSL 3.2.0-dev is installed.
        QT version is 6.5.2.

        J Offline
        J Offline
        JoeCFD
        wrote on 11 Aug 2023, 13:31 last edited by
        #2

        @rctm you wrap these libs with your app and deploy it, just like Qt libs.

        R 1 Reply Last reply 14 Aug 2023, 09:04
        0
        • J JoeCFD
          11 Aug 2023, 13:31

          @rctm you wrap these libs with your app and deploy it, just like Qt libs.

          R Offline
          R Offline
          rctm
          wrote on 14 Aug 2023, 09:04 last edited by
          #3

          @JoeCFD In my understanding I've already done that here:
          ldd output of built application:

          libcrypto.so.3 => /usr/local/lib64/libcrypto.so.3 (0x00007face2a90000)
          libssl.so.3 => /usr/local/lib64/libssl.so.3 (0x00007face29d9000)
          
          qt.tlsbackend.ossl: Incompatible version of OpenSSL (built with OpenSSL >= 3.x, runtime version is < 3.x)
          

          Like it's saying here my runtime version is too low, but OpenSSL 3.2.0 is installed.
          Since it works fine in QTCreator I'm thinking it has to be some kind of configuration problem. Is there a setting I'm missing?

          C 1 Reply Last reply 14 Aug 2023, 09:11
          0
          • R rctm
            14 Aug 2023, 09:04

            @JoeCFD In my understanding I've already done that here:
            ldd output of built application:

            libcrypto.so.3 => /usr/local/lib64/libcrypto.so.3 (0x00007face2a90000)
            libssl.so.3 => /usr/local/lib64/libssl.so.3 (0x00007face29d9000)
            
            qt.tlsbackend.ossl: Incompatible version of OpenSSL (built with OpenSSL >= 3.x, runtime version is < 3.x)
            

            Like it's saying here my runtime version is too low, but OpenSSL 3.2.0 is installed.
            Since it works fine in QTCreator I'm thinking it has to be some kind of configuration problem. Is there a setting I'm missing?

            C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 14 Aug 2023, 09:11 last edited by Christian Ehrlicher
            #4

            Since the openssl libs are loaded dynamically on runtime the linker will not help here. I would guess QtCreator is setting the LD_LIBRARY_PATH accordingly so the correct openssl libs are loaded during runtime.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            R 1 Reply Last reply 14 Aug 2023, 11:24
            2
            • C Christian Ehrlicher
              14 Aug 2023, 09:11

              Since the openssl libs are loaded dynamically on runtime the linker will not help here. I would guess QtCreator is setting the LD_LIBRARY_PATH accordingly so the correct openssl libs are loaded during runtime.

              R Offline
              R Offline
              rctm
              wrote on 14 Aug 2023, 11:24 last edited by
              #5

              @Christian-Ehrlicher said in Wrong version of OpenSSL used when deploying application:

              LD_LIBRARY_PATH

              Thank you! I can now run the application from terminal if I add the path of the openssl libs to LD_LIBRARY_PATH.
              Whats weird is that I've already added this path to /etc/ld.so.conf and ran ldconfig, so the path should already be known.

              K 1 Reply Last reply 14 Aug 2023, 13:40
              0
              • JonBJ Offline
                JonBJ Offline
                JonB
                wrote on 14 Aug 2023, 11:32 last edited by
                #6

                @rctm
                Only a guess here. If you are saying you have a different version of the library on LD_LIBRARY_PATH then maybe ld.so.conf only adds an extra place to look by default after LD_LIBRARY_PATH, you have to insert your desired location earlier in LD_LIBRARY_PATH to prevent the other one being found first?

                1 Reply Last reply
                0
                • R rctm
                  14 Aug 2023, 11:24

                  @Christian-Ehrlicher said in Wrong version of OpenSSL used when deploying application:

                  LD_LIBRARY_PATH

                  Thank you! I can now run the application from terminal if I add the path of the openssl libs to LD_LIBRARY_PATH.
                  Whats weird is that I've already added this path to /etc/ld.so.conf and ran ldconfig, so the path should already be known.

                  K Offline
                  K Offline
                  kkoehne
                  Moderators
                  wrote on 14 Aug 2023, 13:40 last edited by
                  #7

                  @rctm When openssl is loaded at runtime, Qt does not use ld. Instead, it checks out directories in LD_LIBRARY_PATH, and some default locations (/lib, /usr/lib , /usr/local/lib , as well the lib32 and lib64variants:

                  https://codebrowser.dev/qt5/qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp.html#_ZL15libraryPathListv

                  So augmenting /etc/ld.so.conf won't make a difference.

                  Director R&D, The Qt Company

                  1 Reply Last reply
                  2
                  • R rctm has marked this topic as solved on 17 Aug 2023, 08:21
                  • mzimmersM mzimmers referenced this topic on 7 Dec 2023, 19:26

                  1/7

                  11 Aug 2023, 09:29

                  • Login

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