侧边栏壁纸
博主头像
三味的小站 博主等级

世界上没有偶然,有的只是必然的结果。

  • 累计撰写 64 篇文章
  • 累计创建 14 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

qt.network.ssl: QSslSocket: cannot resolve CRYPTO_num_locks

三味线
2025-02-19 / 0 评论 / 0 点赞 / 21 阅读 / 0 字 / 正在检测是否收录...

环境:Red Hat 8.10,Qt 5.6.3

报错如下:

qt.network.ssl: QSslSocket: cannot resolve CRYPTO_num_locks
qt.network.ssl: QSslSocket: cannot resolve CRYPTO_set_id_callback
qt.network.ssl: QSslSocket: cannot resolve CRYPTO_set_locking_callback
qt.network.ssl: QSslSocket: cannot resolve ERR_free_strings
qt.network.ssl: QSslSocket: cannot resolve EVP_CIPHER_CTX_cleanup
qt.network.ssl: QSslSocket: cannot resolve EVP_CIPHER_CTX_init
qt.network.ssl: QSslSocket: cannot resolve sk_new_null
qt.network.ssl: QSslSocket: cannot resolve sk_push
qt.network.ssl: QSslSocket: cannot resolve sk_free
qt.network.ssl: QSslSocket: cannot resolve sk_num
qt.network.ssl: QSslSocket: cannot resolve sk_pop_free
qt.network.ssl: QSslSocket: cannot resolve sk_value

1.检查openssl版本

查看系统openssl版本,命令行运行:openssl version -a

查看Qt支持的版本,新建一个测试程序:

修改.pro:QT += core gui network

#include "mainwindow.h"
#include <QDebug>
#include <QSslSocket>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    qDebug() << QSslSocket::sslLibraryBuildVersionString();
}

运行后输出如下:

"OpenSSL 1.0.1e-fips 11 Feb 2013"

可以看到和系统中的不一致

2.下载

https://www.openssl.org/source/openssl-1.0.1e.tar.gz

也可直接在github查找并下载:https://github.com/openssl/openssl/releases

3.编译

tar zxvf openssl-1.0.1e.tar.gz
cd openssl-1.0.1e
./config shared
make

4.复制库到对应目录

cp -a libcrypto.so* libssl.so* /opt/Qt5.6.3/5.6.3/gcc_64/lib

https://blog.csdn.net/weixin_73899513/article/details/135847891

0

评论区