How to properly include openssl for a windows deployment when using mingw?



  • I've been told that libeay32.dll and ssleay32.dll in Qt\Tools\mingw*\opt\bin is supposed to be used, but I'm not sure how to best include them in a deployment. I was hoping windeployqt handled this, but it seems like it doesn't.

    I see two options. Either copy the dlls manually from the Qt dir into a 3rdparty lib folder that we have full control over, or copy from Qt at each build/deploy.

    The first one has the advantage of giving us control over which version we include. The latter will keep us up to date with whatever Qt version we use include.

    Any thoughts on this? There probably are more options :-)


  • Lifetime Qt Champion

    Hi,

    It's not handled because by default, OpenSSL is dlopened and Qt doesn't ship OpenSSL because of international laws about cryptographic software.

    The ideal is to have the latest version supported by your current version of Qt and ship that one. i.e. Qt < 5.10 = OpenSSL 1.0.X and starting with 5.10 OpenSSL 1.1.X.



  • How would you ship it?

    • I cannot find openssl distributions for windows that are built for mingw. The one I've tried depends on visual c++ 2008 redistributable (which it include if you install it by using the setup). (https://slproweb.com/products/Win32OpenSSL.html)
    • Include as separate step in installation? (maybe as an unattended install)
    • Include a copy of the dlls?

    Another issues I have seen is that the dlls in Qt\Tools\mingw*\opt\bin seem to take much longer time to perform the initial handshake. (I've got reports from Windows users that wait 10+ seconds).

    My goal is simple installation (no sudden missing openssl dependencies at runtime) and a decent handshake time :)


  • Lifetime Qt Champion

    Include a copy of the .dlls with your application like you do for the Qt .dlls that you need.

    There's this Wiki page about building OpenSSL with MinGW that might be of interest.



  • Thanks! I've built it with mingw now, and it seems to work fine without the delay!


  • Lifetime Qt Champion

    Great !

    Then please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.