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. first build on Linux: OpenSSL issue
Forum Updated to NodeBB v4.3 + New Features

first build on Linux: OpenSSL issue

Scheduled Pinned Locked Moved Solved Installation and Deployment
32 Posts 3 Posters 6.3k Views 2 Watching
  • 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.
  • M Offline
    M Offline
    mzimmers
    wrote on 7 Dec 2023, 19:26 last edited by mzimmers 12 Jul 2023, 20:01
    #1

    Hi all -

    I just started getting my app to run on Linux (Ubuntu 22.04). It builds fine (and actually runs fine), but on startup I get an error:

    qt.tlsbackend.ossl: Incompatible version of OpenSSL (built with OpenSSL >= 3.x, runtime version is < 3.x)
    

    I found this topic, and I think I understand the problem, but I want to make sure.

    1. do I correctly understand that I'm building my app with a more recent version of OpenSSL (3.x) than Qt wants me to use?
    2. per the other thread, I did download an older version of OpenSSL. Per the other topic, I guess I need to add its path to the environment variable LD_LIBRARY_PATH (which currently doesn't even exist on my new system). But if I create such an entry, doesn't that imply that any of my other apps will attempt to run the old version (which is possibly undesirable)?
    3. if my assumption in (2) is correct, would it be preferable to set the environment variable in my CMakeLists.txt file, using the set() command?

    Thanks...

    S 1 Reply Last reply 7 Dec 2023, 19:48
    0
    • M mzimmers
      11 Dec 2023, 17:05

      @JoeCFD

      mzimmers@LinuxBoxZimmers:/usr/lib/x86_64-linux-gnu$ sudo apt list openssl
      Listing... Done
      openssl/focal-updates,focal-security,now 1.1.1f-1ubuntu2.20 amd64 [installed]
      openssl/focal-updates,focal-security 1.1.1f-1ubuntu2.20 i386
      mzimmers@LinuxBoxZimmers:/usr/lib/x86_64-linux-gnu$ 
      
      J Offline
      J Offline
      JoeCFD
      wrote on 11 Dec 2023, 17:14 last edited by JoeCFD 12 Nov 2023, 17:17
      #31

      @mzimmers said in first build on Linux: OpenSSL issue:

      focal

      sudo is not needed. Focal is 20.04, not 22.04. Are you sure you installed 22.04? Could be the case that libssl 1.1 points to focal.

      M 1 Reply Last reply 11 Dec 2023, 17:22
      1
      • M mzimmers
        7 Dec 2023, 19:26

        Hi all -

        I just started getting my app to run on Linux (Ubuntu 22.04). It builds fine (and actually runs fine), but on startup I get an error:

        qt.tlsbackend.ossl: Incompatible version of OpenSSL (built with OpenSSL >= 3.x, runtime version is < 3.x)
        

        I found this topic, and I think I understand the problem, but I want to make sure.

        1. do I correctly understand that I'm building my app with a more recent version of OpenSSL (3.x) than Qt wants me to use?
        2. per the other thread, I did download an older version of OpenSSL. Per the other topic, I guess I need to add its path to the environment variable LD_LIBRARY_PATH (which currently doesn't even exist on my new system). But if I create such an entry, doesn't that imply that any of my other apps will attempt to run the old version (which is possibly undesirable)?
        3. if my assumption in (2) is correct, would it be preferable to set the environment variable in my CMakeLists.txt file, using the set() command?

        Thanks...

        S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 7 Dec 2023, 19:48 last edited by
        #2

        Hi,

        1. language nitpick: you are likely not linking against OpenSSL. The situation is more likely to be: you are using a Qt version that was built to load OpenSSL 3. So the answer is: it will depend on the Qt version that your application will load at run time.
        2. Don't do it system wide. Most of the software that need that use a bash script to set it and then launch the application itself.
        3. You can set LD_LIBRARY_PATH in the run part of the Projet panel or outside of Qt Creator see point 2.

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

        M 1 Reply Last reply 7 Dec 2023, 20:01
        1
        • S SGaist
          7 Dec 2023, 19:48

          Hi,

          1. language nitpick: you are likely not linking against OpenSSL. The situation is more likely to be: you are using a Qt version that was built to load OpenSSL 3. So the answer is: it will depend on the Qt version that your application will load at run time.
          2. Don't do it system wide. Most of the software that need that use a bash script to set it and then launch the application itself.
          3. You can set LD_LIBRARY_PATH in the run part of the Projet panel or outside of Qt Creator see point 2.
          M Offline
          M Offline
          mzimmers
          wrote on 7 Dec 2023, 20:01 last edited by
          #3

          @SGaist sorry, I forgot to mention that I'm using Qt 6.5.3.

          So, in the error message, where it says "built with" -- does that refer to my application, or to the version of Qt I'm running? And, I don't understand the "runtime version" being < 3.x; this is a new system with a new install of Qt, and I do have a libssl3.so in my /usr/lib/x86_64-linux-gnu folder.

          I guess what I'm really asking is, which version of the library should I be trying to use - the old one, or the new one?

          Thanks...

          S J 2 Replies Last reply 7 Dec 2023, 20:22
          0
          • M mzimmers
            7 Dec 2023, 20:01

            @SGaist sorry, I forgot to mention that I'm using Qt 6.5.3.

            So, in the error message, where it says "built with" -- does that refer to my application, or to the version of Qt I'm running? And, I don't understand the "runtime version" being < 3.x; this is a new system with a new install of Qt, and I do have a libssl3.so in my /usr/lib/x86_64-linux-gnu folder.

            I guess what I'm really asking is, which version of the library should I be trying to use - the old one, or the new one?

            Thanks...

            S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 7 Dec 2023, 20:22 last edited by
            #4

            The prebuilt versions of Qt do not link to OpenSSL directly but loads it at run time. So what you see there is the version of OpenSSL that was used to build the loading support. The runtime value is the version of OpenSSL that was found when your application is loaded.

            It is surprising that you have such a mismatch. Can you use strace to check which version of OpenSSL is found ?

            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
            • M mzimmers
              7 Dec 2023, 20:01

              @SGaist sorry, I forgot to mention that I'm using Qt 6.5.3.

              So, in the error message, where it says "built with" -- does that refer to my application, or to the version of Qt I'm running? And, I don't understand the "runtime version" being < 3.x; this is a new system with a new install of Qt, and I do have a libssl3.so in my /usr/lib/x86_64-linux-gnu folder.

              I guess what I'm really asking is, which version of the library should I be trying to use - the old one, or the new one?

              Thanks...

              J Offline
              J Offline
              JoeCFD
              wrote on 7 Dec 2023, 20:26 last edited by JoeCFD 12 Jul 2023, 20:30
              #5

              @mzimmers run
              locate libssl3.so
              to see if you have more than one.

              My guess is you have one with Qt installation and your app is built with it. But when you run your app, it links with the one( /usr/lib/x86_64-linux-gnu/libssl3.so ) installed with distribution. Ubuntu 22.04 has Qt 6.2.4. If you install it, you can purge it because you are not using it.

              M 1 Reply Last reply 7 Dec 2023, 22:15
              0
              • J JoeCFD
                7 Dec 2023, 20:26

                @mzimmers run
                locate libssl3.so
                to see if you have more than one.

                My guess is you have one with Qt installation and your app is built with it. But when you run your app, it links with the one( /usr/lib/x86_64-linux-gnu/libssl3.so ) installed with distribution. Ubuntu 22.04 has Qt 6.2.4. If you install it, you can purge it because you are not using it.

                M Offline
                M Offline
                mzimmers
                wrote on 7 Dec 2023, 22:15 last edited by
                #6

                @JoeCFD

                locate libssl3.so
                /snap/chromium/1135/usr/lib/x86_64-linux-gnu/libssl3.so
                /snap/chromium/2704/usr/lib/x86_64-linux-gnu/libssl3.so
                /snap/gnome-42-2204/141/usr/lib/x86_64-linux-gnu/libssl3.so
                /snap/slack/118/usr/lib/x86_64-linux-gnu/libssl3.so
                /snap/snap-store/433/usr/lib/x86_64-linux-gnu/libssl3.so
                /snap/snap-store/959/usr/lib/x86_64-linux-gnu/libssl3.so
                /usr/lib/firefox/libssl3.so
                /usr/lib/thunderbird/libssl3.so
                /usr/lib/x86_64-linux-gnu/libssl3.so
                

                This might be of more interest:

                mzimmers@LinuxBoxZimmers:/usr/lib/x86_64-linux-gnu$ ls -l libssl*
                -rw-r--r-- 1 root root  382024 Feb 17  2023 libssl3.so
                -rw-r--r-- 1 root root 1016494 Oct 10 02:03 libssl.a
                lrwxrwxrwx 1 root root      13 Oct 10 02:03 libssl.so -> libssl.so.1.1
                -rw-r--r-- 1 root root  598104 Oct 10 02:03 libssl.so.1.1
                mzimmers@LinuxBoxZimmers:/usr/lib/x86_64-linux-gnu$ 
                

                If I understand this, my system is set up to use 1.1 (that's where the link is pointing)...is that how it should be?

                @SGaist can you give me the proper invocation for strace? I tried it, but it just gives reams of output.

                Thanks...

                J 1 Reply Last reply 7 Dec 2023, 22:38
                0
                • M mzimmers
                  7 Dec 2023, 22:15

                  @JoeCFD

                  locate libssl3.so
                  /snap/chromium/1135/usr/lib/x86_64-linux-gnu/libssl3.so
                  /snap/chromium/2704/usr/lib/x86_64-linux-gnu/libssl3.so
                  /snap/gnome-42-2204/141/usr/lib/x86_64-linux-gnu/libssl3.so
                  /snap/slack/118/usr/lib/x86_64-linux-gnu/libssl3.so
                  /snap/snap-store/433/usr/lib/x86_64-linux-gnu/libssl3.so
                  /snap/snap-store/959/usr/lib/x86_64-linux-gnu/libssl3.so
                  /usr/lib/firefox/libssl3.so
                  /usr/lib/thunderbird/libssl3.so
                  /usr/lib/x86_64-linux-gnu/libssl3.so
                  

                  This might be of more interest:

                  mzimmers@LinuxBoxZimmers:/usr/lib/x86_64-linux-gnu$ ls -l libssl*
                  -rw-r--r-- 1 root root  382024 Feb 17  2023 libssl3.so
                  -rw-r--r-- 1 root root 1016494 Oct 10 02:03 libssl.a
                  lrwxrwxrwx 1 root root      13 Oct 10 02:03 libssl.so -> libssl.so.1.1
                  -rw-r--r-- 1 root root  598104 Oct 10 02:03 libssl.so.1.1
                  mzimmers@LinuxBoxZimmers:/usr/lib/x86_64-linux-gnu$ 
                  

                  If I understand this, my system is set up to use 1.1 (that's where the link is pointing)...is that how it should be?

                  @SGaist can you give me the proper invocation for strace? I tried it, but it just gives reams of output.

                  Thanks...

                  J Offline
                  J Offline
                  JoeCFD
                  wrote on 7 Dec 2023, 22:38 last edited by
                  #7

                  @mzimmers show
                  ldd your app | grep libssl

                  M 1 Reply Last reply 7 Dec 2023, 22:40
                  0
                  • J JoeCFD
                    7 Dec 2023, 22:38

                    @mzimmers show
                    ldd your app | grep libssl

                    M Offline
                    M Offline
                    mzimmers
                    wrote on 7 Dec 2023, 22:40 last edited by
                    #8

                    @JoeCFD nothing.

                    J 1 Reply Last reply 7 Dec 2023, 22:41
                    0
                    • M mzimmers
                      7 Dec 2023, 22:40

                      @JoeCFD nothing.

                      J Offline
                      J Offline
                      JoeCFD
                      wrote on 7 Dec 2023, 22:41 last edited by
                      #9

                      @mzimmers ldd your app

                      M 1 Reply Last reply 7 Dec 2023, 22:42
                      0
                      • J JoeCFD
                        7 Dec 2023, 22:41

                        @mzimmers ldd your app

                        M Offline
                        M Offline
                        mzimmers
                        wrote on 7 Dec 2023, 22:42 last edited by
                        #10

                        @JoeCFD I did:

                        mzimmers@LinuxBoxZimmers:~/QtProjects/build-NgaIcdFw-Desktop_Qt_6_5_3_GCC_64bit-Debug$ ldd appNgaIcdFw | grep libssl
                        mzimmers@LinuxBoxZimmers:~/QtProjects/build-NgaIcdFw-Desktop_Qt_6_5_3_GCC_64bit-Debug$ 
                        
                        J 1 Reply Last reply 7 Dec 2023, 22:46
                        0
                        • M mzimmers
                          7 Dec 2023, 22:42

                          @JoeCFD I did:

                          mzimmers@LinuxBoxZimmers:~/QtProjects/build-NgaIcdFw-Desktop_Qt_6_5_3_GCC_64bit-Debug$ ldd appNgaIcdFw | grep libssl
                          mzimmers@LinuxBoxZimmers:~/QtProjects/build-NgaIcdFw-Desktop_Qt_6_5_3_GCC_64bit-Debug$ 
                          
                          J Offline
                          J Offline
                          JoeCFD
                          wrote on 7 Dec 2023, 22:46 last edited by JoeCFD 12 Jul 2023, 22:46
                          #11

                          @mzimmers no need. The Qt plugin has issue. Not your code.

                          M 1 Reply Last reply 7 Dec 2023, 22:52
                          0
                          • J JoeCFD
                            7 Dec 2023, 22:46

                            @mzimmers no need. The Qt plugin has issue. Not your code.

                            M Offline
                            M Offline
                            mzimmers
                            wrote on 7 Dec 2023, 22:52 last edited by
                            #12

                            @JoeCFD which plugin are you referring to?

                            J 1 Reply Last reply 7 Dec 2023, 22:59
                            0
                            • M mzimmers
                              7 Dec 2023, 22:52

                              @JoeCFD which plugin are you referring to?

                              J Offline
                              J Offline
                              JoeCFD
                              wrote on 7 Dec 2023, 22:59 last edited by JoeCFD 12 Jul 2023, 23:07
                              #13

                              @mzimmers
                              Qt has a plugin libqopensslbackend.so in under gcc_64/plugins/tls. But I can see the direct link to libssl.

                              Anyway, libssl.so -> libssl.so.1.1 softlink always points to libssl.so.1.1.
                              I guess if you softlink libssl.so to libssl3.so, the problem may be gone. However, other packages in your system may be affected if they use 1.1.

                              M 1 Reply Last reply 7 Dec 2023, 23:08
                              1
                              • J JoeCFD
                                7 Dec 2023, 22:59

                                @mzimmers
                                Qt has a plugin libqopensslbackend.so in under gcc_64/plugins/tls. But I can see the direct link to libssl.

                                Anyway, libssl.so -> libssl.so.1.1 softlink always points to libssl.so.1.1.
                                I guess if you softlink libssl.so to libssl3.so, the problem may be gone. However, other packages in your system may be affected if they use 1.1.

                                M Offline
                                M Offline
                                mzimmers
                                wrote on 7 Dec 2023, 23:08 last edited by
                                #14

                                @JoeCFD said in first build on Linux: OpenSSL issue:

                                Qt has a plugin libqopensslbackend.so in under gcc_64/plugins/tls. But I can see the direct link to libssl.

                                And this plugin links to version 1.1 of OpenSSL? Or is this because of the link in my /usr/lib/x86_64-linux-gnu folder?

                                I'd prefer to eliminate the error message, but not at the expense of breaking other applications in the system.

                                J 1 Reply Last reply 8 Dec 2023, 15:44
                                0
                                • M mzimmers
                                  7 Dec 2023, 23:08

                                  @JoeCFD said in first build on Linux: OpenSSL issue:

                                  Qt has a plugin libqopensslbackend.so in under gcc_64/plugins/tls. But I can see the direct link to libssl.

                                  And this plugin links to version 1.1 of OpenSSL? Or is this because of the link in my /usr/lib/x86_64-linux-gnu folder?

                                  I'd prefer to eliminate the error message, but not at the expense of breaking other applications in the system.

                                  J Offline
                                  J Offline
                                  JoeCFD
                                  wrote on 8 Dec 2023, 15:44 last edited by
                                  #15

                                  @mzimmers Which Qt modules are you using? I ran a few Qt 6.6 network examples and could not see your issue.

                                  M 1 Reply Last reply 8 Dec 2023, 15:50
                                  0
                                  • J JoeCFD
                                    8 Dec 2023, 15:44

                                    @mzimmers Which Qt modules are you using? I ran a few Qt 6.6 network examples and could not see your issue.

                                    M Offline
                                    M Offline
                                    mzimmers
                                    wrote on 8 Dec 2023, 15:50 last edited by mzimmers 12 Aug 2023, 15:50
                                    #16

                                    @JoeCFD

                                    Qt 6.5.3
                                    Desktop gcc 64-bit
                                    WebAssembly (single-threaded)
                                    Android
                                    Sources
                                    Qt HTTP Server (TP)
                                    Qt Virtual Keyboard
                                    Qt WebSockets

                                    Thanks...

                                    J 1 Reply Last reply 8 Dec 2023, 20:48
                                    0
                                    • S Offline
                                      S Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on 8 Dec 2023, 20:19 last edited by
                                      #17

                                      How come you have both OpenSSL 3 and 1.1 ?

                                      How did you install them ?

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

                                      M 1 Reply Last reply 8 Dec 2023, 21:59
                                      0
                                      • M mzimmers
                                        8 Dec 2023, 15:50

                                        @JoeCFD

                                        Qt 6.5.3
                                        Desktop gcc 64-bit
                                        WebAssembly (single-threaded)
                                        Android
                                        Sources
                                        Qt HTTP Server (TP)
                                        Qt Virtual Keyboard
                                        Qt WebSockets

                                        Thanks...

                                        J Offline
                                        J Offline
                                        JoeCFD
                                        wrote on 8 Dec 2023, 20:48 last edited by
                                        #18

                                        @mzimmers I have two in my computer as well. But my libssl points to libssl.so.3 and openssl version shows OpenSSL 3.0.2.

                                        Maybe you can try to reinstall it.
                                        sudo apt-get reinstall openssl
                                        and then run
                                        openssl version
                                        to see if you have the right version

                                        M 1 Reply Last reply 8 Dec 2023, 21:58
                                        0
                                        • J JoeCFD
                                          8 Dec 2023, 20:48

                                          @mzimmers I have two in my computer as well. But my libssl points to libssl.so.3 and openssl version shows OpenSSL 3.0.2.

                                          Maybe you can try to reinstall it.
                                          sudo apt-get reinstall openssl
                                          and then run
                                          openssl version
                                          to see if you have the right version

                                          M Offline
                                          M Offline
                                          mzimmers
                                          wrote on 8 Dec 2023, 21:58 last edited by
                                          #19

                                          @JoeCFD still points to 1.1. shrug

                                          I suppose I could manually relink it, but I'm not sure about the side effects.

                                          1 Reply Last reply
                                          0
                                          • S SGaist
                                            8 Dec 2023, 20:19

                                            How come you have both OpenSSL 3 and 1.1 ?

                                            How did you install them ?

                                            M Offline
                                            M Offline
                                            mzimmers
                                            wrote on 8 Dec 2023, 21:59 last edited by
                                            #20

                                            @SGaist I have no idea - this is how the system came to me. The only real change my IT department made was to install some anti-virus application; maybe that used the older version of openssl?

                                            J 1 Reply Last reply 8 Dec 2023, 22:29
                                            0

                                            1/32

                                            7 Dec 2023, 19:26

                                            • Login

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