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. Qt 5.6.2 on Windows, static build with openssl 1.0.2L and MinGW492_32

Qt 5.6.2 on Windows, static build with openssl 1.0.2L and MinGW492_32

Scheduled Pinned Locked Moved Solved Installation and Deployment
14 Posts 2 Posters 6.9k 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.
  • M Offline
    M Offline
    Matthieu 0
    wrote on 3 Oct 2017, 07:16 last edited by
    #5

    hi,
    I have only one version installed.
    I realized that I didn't use the right Qt prompt, I was in dynamic environment.
    But, I still have problems in static environment.
    Do I need to link to -lssl, -lcrypto -llibeay32 -lssleay32, in the OPENSSL_LIBS ??

    I don't really understand the difference between -openssl and -openssl-linked.
    Is it possible to link statically openssl when I build my project instead of link to the Qt build?
    Best regards,

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Matthieu 0
      wrote on 3 Oct 2017, 13:19 last edited by
      #6

      When I execute in debug mode my application, I get this error :

      qt.network.ssl: QSslSocket: cannot resolve SSL_set_psk_client_callback
      qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_client_method
      qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_client_method
      qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_server_method
      qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_server_method
      qt.network.ssl: QSslSocket: cannot resolve SSL_select_next_proto
      qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb
      qt.network.ssl: QSslSocket: cannot resolve SSL_get0_next_proto_negotiated
      Auto configuration failed
      5672:error:02001015:system library:fopen:Is a directory:.\crypto\bio\bss_file.c:126:fopen('d:/test/openssl098kvc6/openssl.cnf','rb')
      5672:error:2006D002:BIO routines:BIO_new_file:system lib:.\crypto\bio\bss_file.c:131:
      5672:error:0E078002:configuration file routines:DEF_LOAD:system lib:.\crypto\conf\conf_def.c:199:
      QMutex: destroying locked mutex
      

      What I need to do to fix this, please?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 3 Oct 2017, 13:45 last edited by
        #7

        It looks like you didn't explicitly state that you wanted OpenSSL to be linked to Qt (-openssl-linked) so it tries to load the library but it can't find it. One way to check that is to go the Run part of the Project panel and modify the PATH environment variable there to include the path to the OpenSSL .dlls.

        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 Offline
          M Offline
          Matthieu 0
          wrote on 3 Oct 2017, 13:47 last edited by Matthieu 0 10 Mar 2017, 13:48
          #8

          So I need to build with -openssl-linked.
          But do I need to add some build options? like -lssl -lcrypto -lssleay -llibeay32?

          In dependency walker, there is no openssl dll.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 3 Oct 2017, 20:24 last edited by
            #9

            Because by default Qt loads the .dll it doesn't link against it.

            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
            1
            • M Offline
              M Offline
              Matthieu 0
              wrote on 5 Oct 2017, 12:22 last edited by
              #10

              Is it possible to build qt without openssl dll dependencies?
              I don't know if I am on the wrong way.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 5 Oct 2017, 21:21 last edited by
                #11

                Yes, use -openssl-linked and a static build of OpenSSL.

                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 Offline
                  M Offline
                  Matthieu 0
                  wrote on 12 Oct 2017, 07:36 last edited by Matthieu 0 10 Dec 2017, 12:18
                  #12

                  Hello,
                  To answer myself, I found the solution and here is how I did it.

                  First, I build openssl in static mode. You need to install active perl, mingw-get-setup.exe and mysys-1.0.11.exe (i'm not sure if this one is really required). I downloaded the openssl-1.0.2l sources and I followed this guide: http://www.stringcat.com/company_blog/2015/12/07/compiling-openssl-on-windows-mingw32/
                  To build, start mingw, go to the openssl root directory and run:

                  perl Configure mingw no-shared
                  

                  At the end, I created a subdirectory named lib in the openssl dir and copied libssl.a and libcrypo.a into it.

                  To build Qt, I used this script:
                  https://sourceforge.net/p/qtlmovie/code/ci/v1.2.16/tree/build/windows-build-qt-static.ps1?format=raw
                  I added these parameters to the configure line:

                  -openssl-linked -I c:\openssl\include -L c:\openssl\lib
                  

                  In this script, I added a pause between configure and make to be able to modify a file juste before the compilation phase. Just write a new line below configure and write: pause.

                  Execute the script.

                  When the script is paused, open the qtbase/mkspecs/qmodule.pri file and change:

                  -lssleay32 -llibeay32
                  

                  to:

                  -lssl -lcrypto -lgdi32
                  

                  and save the file.

                  Press any key to continue the pause. Wait, enjoy.

                  I think this is a bug in the Qt build system, with openssl-linked we shouldn't have linked to *eay32...

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 12 Oct 2017, 19:55 last edited by
                    #13

                    IIRC, it's Windows VS *nix naming issue with OpenSSL so not a bug.

                    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 Offline
                      M Offline
                      Matthieu 0
                      wrote on 13 Oct 2017, 06:29 last edited by
                      #14

                      So, it's a bug, for me :D

                      1 Reply Last reply
                      0

                      14/14

                      13 Oct 2017, 06:29

                      • Login

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