sslechoserver demo does not work
This question was posted in the past, but I didn't see a solution. So I'll ask again, and hopefully somebody more knowledgeable than me has solved it since then.
I built and ran the Qt sslechoserver demo on Windows by loading its PRO project file into Visual Studio with the Qt add-in, setting the appropriate directories to find Qt components, and loading OpenSSL (so that SSL methods would be resolved at runtime). The demo comes up and indicates it's listening on port 1234, as expected.
The problem is that I cannot make a connection to this server with the supplied WebSocket client, sslechoclient.html. I get the following error when I attempt the connection (the demo and server use: wss://localhost:1234):
I suspect the problem has something to do with the certificate authorization.
Note that I have had no problem building/running the non-SSL version of this demo (which opens from the client with ws://localhost:1234).
Any guidance on this would be most appreciated.
Thanks very much.
Any solution? With Qt 5.5 the problem remains unsolved and only thing I can think about is using some workaround (eg. encrypting message strings or using third-party library for SSL) which doesn't solve the original problem (bug?).
I have the same problem here, looking for a fix...
Likely, your build from Qt "Example" source lacks two DLLs essential to an OpenSSL application and not distributed by Qt:
To get these, you've three options:
- find them somewhere else on your system, maybe from
- download binaries from somewhere, maybe through http://docwiki.embarcadero.com/RADStudio/Rio/en/OpenSSL
- better yet, download source from https://openssl.org/ and build them from that.
Wherever you find these DLLs, copy them into the directory containing your example executable, then try running it again.
Edin-M last edited by
What @kevinc said + in my case, I had to copy libcrypto-1_1.dll and libssl-1_1.dll from C:\Qt\Tools\OpenSSL\Win_x86\bin (for me it's 32-bit app, but use 64-bit if you need) over to the .exe folder to be able to run the sslechoserver and sslechoclient examples. Also I had to add error() listener using QOverload otherwise no error shows up but in this listener there is UnsupportedSocketOperationError if there are no DLLs present.
You can get Qt OpenSSL dlls from the maintenance tool.
Version: Qt 5.15.1, x86 (32bit).