如何在 QT 上配置 OpenSSL [英] How to configure OpenSSL on the QT

查看:244
本文介绍了如何在 QT 上配置 OpenSSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让我的 QwebView/QNetWorkRequestSSL 一起工作?

How can I make my QwebView/QNetWorkRequest work with SSL?

QT 返回这个错误(很明显错误发生是因为我没有在我的应用程序中配置 SSL):

QT return this errors (is clear that the error occurs because I did not configure SSL in my application):

QSslSocket: 无法解析 OPENSSL_add_all_algorithms_noconfQSslSocket:无法解析 OPENSSL_add_all_algorithms_confQSslSocket:无法调用未解析的函数 OPENSSL_add_all_algorithms_conf

QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf QSslSocket: cannot call unresolved function OPENSSL_add_all_algorithms_conf

我在 Windows 32 位(MinGW 4.8、OpenGL)上使用 Qt 5.1.1 - 我的窗口是 64 位

I am use Qt 5.1.1 for Windows 32-bit (MinGW 4.8, OpenGL) - my window is 64bit

老实说,我不知道从哪里开始.我搜索过但没有找到任何显示 QNetWorkRequest 的 trabalar SSL 的地方.

I'll be honest, I have no idea where to start. I searched but have not found anywhere that shows how trabalar SSL with QNetWorkRequest.

我安装了 openSslWin32(我的 Windows 是 64 位,但我的应用程序是 32 位),我试试这个:

I install openSslWin32 (my Windows is 64bit, but my application is 32bit), I try this:

专业文件:

LIBS += -LC:/OpenSSL-Win32/lib -lubsec
INCLUDEPATH += C:/OpenSSL-Win32/include

cpp 文件:

#include <openssl/aes.h>

但继续显示错误.

我知道它缺少一些东西,但不知道到底是什么,请原谅我是初学者.

I know it is missing something, but do not know what exactly, forgive me I'm beginner.

推荐答案

我正在安装 OpenSSL 32 位,现在正在工作.

I am install OpenSSL 32bit, is now working.

下载适用于 Windows 的预编译:

http://slproweb.com/products/Win32OpenSSL.html

下载:

安装复制 DLL 后(来自 C:\OpenSSL-Win32C:\OpenSSL-Win64,取决于您将使用 Qt 32 位还是 Qt 64 位编译)对于 releasedebug 项目文件夹:

After install copy DLLs (from C:\OpenSSL-Win32 or C:\OpenSSL-Win64, depends on whether you will compile with Qt 32bit or Qt 64bit) for release or debug project folder:

  • libeay32.dll
  • libssl32.dll
  • ssleay32.dll

注意:无需在LIBS +="中添加任何内容

Note: No need to add anything to "LIBS +="

这篇关于如何在 QT 上配置 OpenSSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆