不支持 ssl 套接字错误 [英] ssl sockets not supported error
问题描述
我正在 linux centos 6.6 上运行 tornado webserver 以实现安全的 websocket 连接.我正在使用 Qt/c++ 客户端通过打开像wss://191.23.4.56/etr/job"这样的 URL 来使用 QWebsocket 进行连接.我收到这样的错误,此平台不支持 SSL 套接字"这是什么错误?
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?
推荐答案
错误消息 SSL sockets are not supported in this platform" 由 QWebSocket::open()<打印/code> 当 URL 方案是
wss
并且 QSslSocket::supportsSsl()
返回 false
.
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
.
静态成员函数QSslSocket::supportsSsl()
:
The static member function QSslSocket::supportsSsl()
:
如果此平台支持 SSL,则返回 true;否则,返回 false.如果平台不支持 SSL,则套接字将失败连接阶段.
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.
那是你的主要问题.现在我们需要找出为什么 Qt
认为平台不支持 SSL.
That is your main problem. Now we need to find out why Qt
thinks that SSL is not supported by the platform.
如果您将 Qt 作为二进制包下载,函数 supportsSsl()
会尝试动态加载所需的库 libssl
和 libcrypto
.
If you downloaded Qt as a binary package the function supportsSsl()
tries to load required libraries libssl
and libcrypto
dynamically.
如果这些库无法加载,函数 supportsSsl()
返回 false
.
If those libraries cannot be loaded the function supportsSsl()
returns false
.
您的系统中可能没有安装 libssl
.如果您可以在系统中找到库二进制文件,但 Qt 未加载它们,则您的二进制 libssl
和/或 libcrypto
可能与二进制 Qt 不兼容.
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.
为避免此类问题,您可以构建自己的 Qt.例如,有一个新的指令如何构建 Qt-5.5.1.注意 -openssl-linked
配置开关的技巧.它支持将 OpenSSL 库集成到 Qt5 库中,而不是在运行时动态加载它们.
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.
这篇关于不支持 ssl 套接字错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!