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. Does Qt 5.15 support OpenSSL 3.x?

Does Qt 5.15 support OpenSSL 3.x?

Scheduled Pinned Locked Moved Solved Installation and Deployment
27 Posts 11 Posters 9.3k 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.
  • S SGaist
    17 Jul 2023, 07:02

    @julianoes hi,

    If the support has been backported, then you have to get the corresponding (or later) sources and build Qt yourself. Depending on the distribution you use, its own Qt version may already be patched to support OpenSSL v3.

    J Offline
    J Offline
    julianoes
    wrote on 18 Jul 2023, 22:37 last edited by
    #12

    @SGaist said in Does Qt 5.15 support OpenSSL 3.x?:

    Depending on the distribution you use, its own Qt version may already be patched to support OpenSSL v3.

    That's an interesting comment. Thanks @SGaist. So far, we always downloaded Qt using the installer and used that to build. Depending on the OS (ubuntu 22.04) one tended to be tricky and the wrong version but I might give that a try.

    It's a shame that Qt doesn't make a patch release to fixup something security related like that.

    J 1 Reply Last reply 19 Jul 2023, 01:35
    0
    • J julianoes
      18 Jul 2023, 22:37

      @SGaist said in Does Qt 5.15 support OpenSSL 3.x?:

      Depending on the distribution you use, its own Qt version may already be patched to support OpenSSL v3.

      That's an interesting comment. Thanks @SGaist. So far, we always downloaded Qt using the installer and used that to build. Depending on the OS (ubuntu 22.04) one tended to be tricky and the wrong version but I might give that a try.

      It's a shame that Qt doesn't make a patch release to fixup something security related like that.

      J Offline
      J Offline
      JKSH
      Moderators
      wrote on 19 Jul 2023, 01:35 last edited by
      #13

      @julianoes said in Does Qt 5.15 support OpenSSL 3.x?:

      It's a shame that Qt doesn't make a patch release to fixup something security related like that.

      Qt 5.15 has reached end-of-life (see https://www.qt.io/blog/qt-5.15-support-ends ). When security is important, use an actively-maintained version. Qt 6.5 uses OpenSSL 3 by default.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        QuantumTransistor
        wrote on 19 Jul 2023, 07:41 last edited by
        #14

        Thanks @Taytoo, I'll give static linking a try. Which version of Qt are you using? This bug report gives a patch for using 5.15.9 with OpenSSL 3. I'm using 5.15.10 (the latest available open-source), and not sure if a similar patch is still needed.

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          QuantumTransistor
          wrote on 19 Jul 2023, 13:43 last edited by
          #15

          Following the suggestion from @Taytoo, I got Qt5.15.10 and OpenSSL 3.1.1 to work correctly for my application.

          OpenSSL configure settings were:

          -openssl-linked OPENSSL_INCDIR="C:\Path\To\OpenSSL\3.1.1\include" OPENSSL_LIBDIR="C:\Path\To\OpenSSL\3.1.1\lib\VC\static" OPENSSL_LIBS="-lWs2_32 -lGdi32 -lAdvapi32 -lCrypt32 -lUser32" OPENSSL_LIBS_DEBUG="-llibssl64MDd -llibcrypto64MDd" OPENSSL_LIBS_RELEASE="-llibssl64MD -llibcrypto64MD"
          

          Still a bit puzzled why -openssl-runtime doesn't work, but I'll keep trying now that I know the codes are compatible.

          T 1 Reply Last reply 21 Jul 2023, 13:35
          1
          • Q QuantumTransistor
            19 Jul 2023, 13:43

            Following the suggestion from @Taytoo, I got Qt5.15.10 and OpenSSL 3.1.1 to work correctly for my application.

            OpenSSL configure settings were:

            -openssl-linked OPENSSL_INCDIR="C:\Path\To\OpenSSL\3.1.1\include" OPENSSL_LIBDIR="C:\Path\To\OpenSSL\3.1.1\lib\VC\static" OPENSSL_LIBS="-lWs2_32 -lGdi32 -lAdvapi32 -lCrypt32 -lUser32" OPENSSL_LIBS_DEBUG="-llibssl64MDd -llibcrypto64MDd" OPENSSL_LIBS_RELEASE="-llibssl64MD -llibcrypto64MD"
            

            Still a bit puzzled why -openssl-runtime doesn't work, but I'll keep trying now that I know the codes are compatible.

            T Offline
            T Offline
            Taytoo
            wrote on 21 Jul 2023, 13:35 last edited by
            #16

            @QuantumTransistor I've never linked with openssl dynamically, so can't really help with that. Try changing Lib path to point towards .so/.dll files instead and see if that works.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              seyed
              wrote on 29 Jul 2023, 23:59 last edited by
              #17

              I used OpenSSL 3 to build Qt 5.15.10 successfully, but at runtime, I faced problems:

              qt.network.ssl: QSslSocket: cannot resolve EVP_PKEY_base_id
              qt.network.ssl: QSslSocket: cannot resolve SSL_get_peer_certificate
              Build version: "OpenSSL 3.1.1 30 May 2023"
              Run version: "OpenSSL 3.1.1 30 May 2023"
              Supports SSL: true
              

              Finally, porting changes from Qt 6 to 5 results in a successful build and run. 🎉
              Read my gist for steps

              1 Reply Last reply
              1
              • Q Offline
                Q Offline
                QuantumTransistor
                wrote on 7 Aug 2023, 13:32 last edited by QuantumTransistor 8 Jul 2023, 13:34
                #18

                @seyed - I used the patch from your gist and was able to successfully build and use Qt 5.15.10 with OpenSSL 3.1.2 using -openssl-runtime. Thanks!! 🎉

                O 1 Reply Last reply 30 Sept 2023, 14:47
                1
                • Q QuantumTransistor
                  7 Aug 2023, 13:32

                  @seyed - I used the patch from your gist and was able to successfully build and use Qt 5.15.10 with OpenSSL 3.1.2 using -openssl-runtime. Thanks!! 🎉

                  O Offline
                  O Offline
                  ocgltd
                  wrote on 30 Sept 2023, 14:47 last edited by ocgltd
                  #19

                  I hope to avoid rebuilding Qt + patches. Will Qt release a 5.15.x update that will allow compilation against openssl 3 ?

                  S Q 2 Replies Last reply 30 Sept 2023, 18:40
                  0
                  • O ocgltd
                    30 Sept 2023, 14:47

                    I hope to avoid rebuilding Qt + patches. Will Qt release a 5.15.x update that will allow compilation against openssl 3 ?

                    S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 30 Sept 2023, 18:40 last edited by
                    #20

                    @ocgltd if memory serves well, the 5.15 LTS has support for OpenSSL 3 so it should eventually come to be.

                    You might want to check the KDE patch set for Qt.

                    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
                    • O ocgltd
                      30 Sept 2023, 14:47

                      I hope to avoid rebuilding Qt + patches. Will Qt release a 5.15.x update that will allow compilation against openssl 3 ?

                      Q Offline
                      Q Offline
                      QuantumTransistor
                      wrote on 3 Oct 2023, 07:56 last edited by
                      #21

                      @ocgltd according to a comment on this bug report, OpenSSL 3 is supported with Qt 5.15.13 onwards. If you are using the open-source version, this should be available 9 March 2024 (one year after the commercial release date).

                      piervalliP 1 Reply Last reply 28 Mar 2024, 12:34
                      0
                      • Q QuantumTransistor
                        3 Oct 2023, 07:56

                        @ocgltd according to a comment on this bug report, OpenSSL 3 is supported with Qt 5.15.13 onwards. If you are using the open-source version, this should be available 9 March 2024 (one year after the commercial release date).

                        piervalliP Offline
                        piervalliP Offline
                        piervalli
                        wrote on 28 Mar 2024, 12:34 last edited by piervalli
                        #22

                        @QuantumTransistor
                        Openssl works with 5.15.13 (open source) but we need to compiare with c++17

                        S 1 Reply Last reply 28 Mar 2024, 21:03
                        0
                        • piervalliP piervalli
                          28 Mar 2024, 12:34

                          @QuantumTransistor
                          Openssl works with 5.15.13 (open source) but we need to compiare with c++17

                          S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 28 Mar 2024, 21:03 last edited by
                          #23

                          @piervalli what issue do you have with C++17 ?
                          Qt 5 requires C++11 and OpenSSL is C.

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

                          piervalliP 1 Reply Last reply 29 Mar 2024, 09:09
                          0
                          • S SGaist
                            28 Mar 2024, 21:03

                            @piervalli what issue do you have with C++17 ?
                            Qt 5 requires C++11 and OpenSSL is C.

                            piervalliP Offline
                            piervalliP Offline
                            piervalli
                            wrote on 29 Mar 2024, 09:09 last edited by
                            #24

                            @SGaist
                            The issue is with Qt 5.15.13 and build by source I haved setted c++17 for that error.
                            text\qlocale_win.cpp:498:60: error: 'size' is not a member of 'std'

                            I used Mingw 8.1

                            JonBJ 1 Reply Last reply 29 Mar 2024, 09:26
                            0
                            • piervalliP piervalli
                              29 Mar 2024, 09:09

                              @SGaist
                              The issue is with Qt 5.15.13 and build by source I haved setted c++17 for that error.
                              text\qlocale_win.cpp:498:60: error: 'size' is not a member of 'std'

                              I used Mingw 8.1

                              JonBJ Offline
                              JonBJ Offline
                              JonB
                              wrote on 29 Mar 2024, 09:26 last edited by
                              #25

                              @piervalli
                              Since https://en.cppreference.com/w/cpp/iterator/size states that C++17 onward is required for std::size() it ought be present. (You might show line #498 of text\qlocale_win.cpp so we know what the call looks like.) That implies either you are not setting for C++17 correctly or the MinGW does not have correct support for it. You might look in the appropriate std::... header file to see what is/is not there for this.

                              piervalliP 1 Reply Last reply 29 Mar 2024, 09:28
                              1
                              • JonBJ JonB
                                29 Mar 2024, 09:26

                                @piervalli
                                Since https://en.cppreference.com/w/cpp/iterator/size states that C++17 onward is required for std::size() it ought be present. (You might show line #498 of text\qlocale_win.cpp so we know what the call looks like.) That implies either you are not setting for C++17 correctly or the MinGW does not have correct support for it. You might look in the appropriate std::... header file to see what is/is not there for this.

                                piervalliP Offline
                                piervalliP Offline
                                piervalli
                                wrote on 29 Mar 2024, 09:28 last edited by
                                #26

                                @JonB Thanks

                                JonBJ 1 Reply Last reply 29 Mar 2024, 09:36
                                0
                                • piervalliP piervalli
                                  29 Mar 2024, 09:28

                                  @JonB Thanks

                                  JonBJ Offline
                                  JonBJ Offline
                                  JonB
                                  wrote on 29 Mar 2024, 09:36 last edited by JonB
                                  #27

                                  @piervalli
                                  Hang on, I see a problem!

                                  Go to that cppreference page. Look at the sample code. Go pick the various c++17 compilers it offers. With GCC 13.1 (C++17) it compiles fine. But with GCC 5.2 (C++17) I get the same error as you show.

                                  So which gcc is the MinGW supposed to emulate? You can go to https://godbolt.org/ and play with selecting different compilers, they include MinGW choices. The oldest they have is MinGW gcc 11.3.0, that seems to work (only errors on std::ssize() in that code, which requires C++20, fair enough).

                                  1 Reply Last reply
                                  0
                                  • JonBJ JonB referenced this topic on 12 Jan 2025, 10:28

                                  • Login

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