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. openSSL in QT
Forum Updated to NodeBB v4.3 + New Features

openSSL in QT

Scheduled Pinned Locked Moved Unsolved General and Desktop
22 Posts 4 Posters 7.8k 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.
  • SGaistS SGaist

    Your application does not link to OpenSSL nor does Qt by default.

    As for when running your application, the dlls must be findable. The usual way is to copy the files in the same folder as your application or modify the PATH environment variable in the Run part of the Project panel.

    S Offline
    S Offline
    saeid0034
    wrote on last edited by
    #13

    @SGaist yes by adding dll in exe folder im able to post data
    but there is anyway to include openssl static?

    jsulmJ 1 Reply Last reply
    0
    • S saeid0034

      @SGaist yes by adding dll in exe folder im able to post data
      but there is anyway to include openssl static?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #14

      @saeid0034 said in openSSL in QT:

      but there is anyway to include openssl static?

      Not without building Qt by yourself as normal Qt builds load OpenSSL libs at runtime.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      4
      • jsulmJ jsulm

        @saeid0034 said in openSSL in QT:

        but there is anyway to include openssl static?

        Not without building Qt by yourself as normal Qt builds load OpenSSL libs at runtime.

        S Offline
        S Offline
        saeid0034
        wrote on last edited by saeid0034
        #15

        @jsulm can anyone tell me i need to pass what in ./configure to build qt with openssl statically
        i use this for build qt static for now

        configure -opensource -confirm-license -static -platform win32-g++ -optimize-size -opengl desktop -prefix "C:\Qt\static" -skip webengine -nomake tests -nomake examples -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -qt-tiff

        i need to add what to build qt static + openssl?

        edit: i see this page in wiki
        based of this page i need to build qt like this

        OPENSSL_LIBS='-L/d/build/ssl/lib -lssl -lcrypto' && configure -opensource -confirm-license -static -platform win32-g++ -openssl-linked -optimize-size -opengl desktop -prefix "C:\Qt\static" -skip webengine -nomake tests -nomake examples -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -qt-tiff

        in this configure OPENSSL_LIBS is Location of openssl-1.1.1g i compiled before (with mingw)

        its all ok?

        jsulmJ 1 Reply Last reply
        0
        • S saeid0034

          @jsulm can anyone tell me i need to pass what in ./configure to build qt with openssl statically
          i use this for build qt static for now

          configure -opensource -confirm-license -static -platform win32-g++ -optimize-size -opengl desktop -prefix "C:\Qt\static" -skip webengine -nomake tests -nomake examples -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -qt-tiff

          i need to add what to build qt static + openssl?

          edit: i see this page in wiki
          based of this page i need to build qt like this

          OPENSSL_LIBS='-L/d/build/ssl/lib -lssl -lcrypto' && configure -opensource -confirm-license -static -platform win32-g++ -openssl-linked -optimize-size -opengl desktop -prefix "C:\Qt\static" -skip webengine -nomake tests -nomake examples -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -qt-tiff

          in this configure OPENSSL_LIBS is Location of openssl-1.1.1g i compiled before (with mingw)

          its all ok?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #16

          @saeid0034 said in openSSL in QT:

          OPENSSL_LIBS='-L/d/build/ssl/lib -lssl -lcrypto

          This looks like linking against shared OpenSSL libs.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 1 Reply Last reply
          1
          • jsulmJ jsulm

            @saeid0034 said in openSSL in QT:

            OPENSSL_LIBS='-L/d/build/ssl/lib -lssl -lcrypto

            This looks like linking against shared OpenSSL libs.

            S Offline
            S Offline
            saeid0034
            wrote on last edited by saeid0034
            #17

            @jsulm you say i do not need to set OPENSSL_LIBS?
            and by the way i think this 2 lib use for shared version libssl.dll.a & libcrypto.dll.a

            and also i use mingw to build openssl and Qt

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Markus43
              wrote on last edited by
              #18

              You don't need to rebuild Qt. Just select OpenSSL in the installer, and do what is suggested here:

              https://stackoverflow.com/questions/59507538/install-openssl-for-msvc2017-on-64-bit-windows-10

              S 1 Reply Last reply
              1
              • M Markus43

                You don't need to rebuild Qt. Just select OpenSSL in the installer, and do what is suggested here:

                https://stackoverflow.com/questions/59507538/install-openssl-for-msvc2017-on-64-bit-windows-10

                S Offline
                S Offline
                saeid0034
                wrote on last edited by
                #19

                @Markus43 thanks for reply, but i need openssl for static build

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  Markus43
                  wrote on last edited by
                  #20

                  Then the question is: Does OpenSSL need to be static, too?

                  If you can live with using OpenSSL dlls while using static Qt, you can just add the following to your configure line (also with OpenSSL from the installer) and you're done.
                  e.g. for x86 builds:

                  -openssl -I C:\Qt\Tools\OpenSSL\Win_x86\include -L C:\Qt\Tools\OpenSSL\Win_x86\lib
                  
                  S 1 Reply Last reply
                  1
                  • M Markus43

                    Then the question is: Does OpenSSL need to be static, too?

                    If you can live with using OpenSSL dlls while using static Qt, you can just add the following to your configure line (also with OpenSSL from the installer) and you're done.
                    e.g. for x86 builds:

                    -openssl -I C:\Qt\Tools\OpenSSL\Win_x86\include -L C:\Qt\Tools\OpenSSL\Win_x86\lib
                    
                    S Offline
                    S Offline
                    saeid0034
                    wrote on last edited by
                    #21

                    @Markus43 said in openSSL in QT:

                    Then the question is: Does OpenSSL need to be static, too?

                    If you can live with using OpenSSL dlls while using static Qt, you can just add the following to your configure line (also with OpenSSL from the installer) and you're done.
                    e.g. for x86 builds:

                    -openssl -I C:\Qt\Tools\OpenSSL\Win_x86\include -L C:\Qt\Tools\OpenSSL\Win_x86\lib
                    

                    for using openssl static too i need to build Qt static with openssl again?

                    M 1 Reply Last reply
                    0
                    • S saeid0034

                      @Markus43 said in openSSL in QT:

                      Then the question is: Does OpenSSL need to be static, too?

                      If you can live with using OpenSSL dlls while using static Qt, you can just add the following to your configure line (also with OpenSSL from the installer) and you're done.
                      e.g. for x86 builds:

                      -openssl -I C:\Qt\Tools\OpenSSL\Win_x86\include -L C:\Qt\Tools\OpenSSL\Win_x86\lib
                      

                      for using openssl static too i need to build Qt static with openssl again?

                      M Offline
                      M Offline
                      Markus43
                      wrote on last edited by
                      #22

                      @saeid0034 said in openSSL in QT:

                      for using openssl static too i need to build Qt static with openssl again?

                      Yes. Think about it: when linking against dlls, the linker only links the OpenSSL function calls in a way that they call the dll. When linking against static OpenSSL, the linker copies the called functions' code into the executable being built.

                      Anyhow, I never did a static build of OpenSSL, so I'm not sure if the line above works for static builds, too.

                      1 Reply Last reply
                      1

                      • Login

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