I'm running tornado webserver for secure websocket connection on linux centos 6.6. I'm using Qt/c++ client to connect using a QWebsocket by opening a url like "wss://191.23.4.56/etr/job". I'm getting error like, "SSL sockets are not supported in this platform" What is this error about?
问题:
回答1:
The error message "SSL sockets are not supported in this platform" is printed by QWebSocket::open()
when the URL scheme is wss
and QSslSocket::supportsSsl()
returns false
.
The static member function QSslSocket::supportsSsl()
:
Returns true if this platform supports SSL; otherwise, returns false. If the platform doesn't support SSL, the socket will fail in the connection phase.
That is your main problem. Now we need to find out why Qt
thinks that SSL is not supported by the platform.
If you downloaded Qt as a binary package the function supportsSsl()
tries to load required libraries libssl
and libcrypto
dynamically.
If those libraries cannot be loaded the function supportsSsl()
returns false
.
It is possible that libssl
is not installed in your system. If you can find the library binaries in your system, but they are not loaded by Qt it possible that your binary libssl
and/or libcrypto
are not compatible with binary Qt.
To avoid such issues you can build your own Qt. For example, there is a fresh instruction how to build Qt-5.5.1. Note the trick with the -openssl-linked
configuration switch. It enables integration of OpenSSL libraries into Qt5 libraries instead of dynamic loading them at runtime.