1

When I run the application from the directory that it was built in, there is no problem but when I try to run the application from another directory, after carrying the exe file in it, OpenSSL does not work.

I copied libcrypto-1_1-x64.dll and libssl-1_1-x64.dll files in the same directory, windeployqt takes care of the other dlls. What could be missing? If it's necessary, how do I make the configuration for the runtime?

3
  • Did you check this post : stackoverflow.com/questions/57235510/… Commented Aug 2, 2021 at 16:26
  • If your OS is windows you should install OpenSSL. Commented Aug 2, 2021 at 17:09
  • It is windows and I'm not able to run openssl command from command line, it gives me error. Tried re-installing but didn't work either. Does it have to work when I'm deploying an application? Commented Aug 2, 2021 at 18:16

1 Answer 1

0

OpenSSL libraries are precompiled with Qt via Qt Maintenance Tool. Because it's a C library it doesn't matter if is MSVC or MingW compiler. This little guide should work:

  1. Install OpenSSL from Maintenance Tool.

enter image description here

  1. Independently of your compiler, go to C:\Qt\Tools\OpenSSL\Win_x64\bin (if you have 64 bits application).

  2. Copy libcrypto-1_1-x64.dll and libssl-1_1-x64.dll and paste in your release or debug application executable.

enter image description here

Sign up to request clarification or add additional context in comments.

6 Comments

Thank you but no matter from where I copied these two dlls, it doesn't work. Could it be related to my Windows version of openssl because it's an older version and I haven't been able to update it?
Mmm. What're your windows build? Qt version? Compiler? OpenSSL version?
It's Windows 10, Qt 6.2 and OpenSSL 1.1.1k. I solved the problem, apparently there are 3 dlls inside QT plugins directory, within tls directory. I copied this tls directory next to my exe and now I can deploy with OpenSSL.
Qt 6.2. Maybe something has changed that needs a third dll. The below short guide is for >5.15.5. Good catch.
@jupi can you provide the path and names of the other dll(s)? Was it these? qcertonlybackend.dll, qopensslbackend.dll, qschannelbackend.dll? From C:\Qt\6.2.0\msvc2019_64\plugins\tls.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.