如何在QT Windows应用程序中启用SSL? [英] how can I enable SSL in QT windows application?

查看:267
本文介绍了如何在QT Windows应用程序中启用SSL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Qt需要在系统上安装开放的SSL库。在debian / ubuntu中,当我使用apt安装open ssl时,一切正常。但是当我在Windows中编译应用程序时,无法使用SSL功能,我可以通过执行以下操作来验证这一点

Qt requires open ssl libraries to be installed on system. In debian / ubuntu when I install open ssl using apt everything works. But when I compile my application in windows, SSL features are not available I can verify this by executing

QSslSocket::supportsSsl()

如何使其在Windows中工作?我从 http://www.slproweb.com/products/Win32OpenSSL.html <下载并安装了Open ssl / a>,但它仍然返回false。

How do I make it work in windows? I downloaded and installed open ssl from http://www.slproweb.com/products/Win32OpenSSL.html but it still returns false.

推荐答案

因此,经过很长时间,我才发现问题所在:

So after long time I figured what the problem is:

这两个库必须与可执行文件位于同一文件夹中,或者位于Windows系统文件夹中(我认为是system32):

These 2 libraries need to be in same folder as your executable OR in windows system folder (system32 I think):

libeay32.dll
ssleay32.dll

您会找到它们在您的OpenSSL文件夹的\bin中,由于我将这2个库复制到那里,因此可以正常工作

You will find them in \bin of your OpenSSL folder, since I copied these 2 libs there it works

重要:在部署到客户端计算机时,是安装用于编译这些.dll的vcredist软件包所必需的,该软件包可能与运行应用程序本身所需的vcredist软件包不同。 vcredist的版本取决于库的版本。

IMPORTANT: When deploying to client computers, it's also necessary to install vcredist package that was used to compile these .dll which may differ from vcredist package needed to run the application itself. vcredist version depends on version of the libraries.

这篇关于如何在QT Windows应用程序中启用SSL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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