V.K*_*.K. 9 c++ ubuntu qt openssl
我尝试构建用于QNetworkManager与服务器通信的应用程序。我在较旧的 Linux 版本上没有遇到任何问题,但在最新的 Ubuntu 22.04 上,网络回复失败,QtCreator 显示以下输出:
Incompatible version of OpenSSL (built with OpenSSL 1.x, runtime version is >= 3.x)
The backend "cert-only" does not support QSslKey
Active TLS backend does not support key creation
The backend "cert-only" does not support QSslKey
Active TLS backend does not support key creation
The backend "cert-only" does not support QSslKey
Active TLS backend does not support key creation
The backend "cert-only" does not support QSslKey
Active TLS backend does not support key creation
The backend "cert-only" does not support QSslKey
Active TLS backend does not support key creation
The backend "cert-only" does not support QSslKey
Active TLS backend does not support key creation
The backend "cert-only" does not support QSslSocket
The backend named "cert-only" does not support TLS
QSslSocket::connectToHostEncrypted: TLS initialization failed
QSslSocket::connectToHostEncrypted: TLS initialization failed
Run Code Online (Sandbox Code Playgroud)
当我在较旧的 Ubuntu (20.04) 上构建应用程序并将其部署为 AppImage,然后在 Ubuntu 22.04 上运行它时,网络通信也失败并出现相同的错误。
如何解决这个问题?我需要能够在较旧的 Ubuntu 上创建 AppImage,然后“在任何地方”运行它......
更新:我设法使用正确的 OpenSSL 库在 Ubuntu 20.04 上构建和部署应用程序的 AppImage,现在它也在 Ubuntu 22.04 上运行。诀窍是libssl.so.1.1在调用之前手动复制到 AppImage lib 文件夹linuxdeployqt。
但我仍然没有找到如何在 Ubuntu 22.04 上使用 QtCreator 构建和运行我的应用程序。幸运的是,这对我来说并不是很重要,因为我构建它是为了在 Ubuntu 20.04 上部署。
我能够按照以下解决方法在 Ubuntu 22.04 和 Qt 6.3.0 上解决此问题:
https://linuxpip.org/install-openssl-linux/
您必须从源代码构建 OpenSSL 1.1 并告诉系统使用新安装的 OpenSSL。
| 归档时间: |
|
| 查看次数: |
5853 次 |
| 最近记录: |