QT使用WebView提示QSslSocket错误

来源:互联网 发布:储钱罐理财软件怎么样 编辑:程序博客网 时间:2024/05/03 00:04

QT使用WebView提示QSslSocket错误

在QT中使用QWebView,运行过程中如果访问支持ssl的网站会提示以下错误,

QSslSocket: cannot call unresolved function SSLv23_client_method

QSslSocket: cannot call unresolved function SSL_CTX_new

QSslSocket: cannot call unresolved function SSL_library_init

QSslSocket: cannot call unresolved function ERR_get_error

原来QT默认是不支持openssl的,经查阅,在http://codeblog.vurdalakov.net/2009/11/solution-qsslsocket-cannot-call.html

这里面看到了解决办法,经过测试解决问题了!

步骤如下:

You need to install OpenSSL Win32 or Win64 binaries.

你需要安装OpenSSL库;

1、Open Win32 OpenSSL Installation Project page.

首先打开OpenSSL Installation Project网页;

2、Download the latest “light” Win32 or Win64 installation package, for example “Win32 OpenSSL v0.9.8l Light”.

下载安装包,我下载的是:Win32 OpenSSL v1.0.1c Light安装包,随着时间的推进,这个版本会不断更新的!!

3、Install it to any location. Ignore “Microsoft Visual C++ 2008 Redistributables” warning (click OK) and select copying OpenSSL DLLs to “The OpenSSL binaries (\bin) directory”.

安装(exe文件)到本地,我是安装到C盘下,并且在安装过程中选择将库安装到OpenSSL的安装目录(/bin)下面。

4、Copy libeay32.dll and ssleay32.dll from the \bin folder to the same place where your QtNetwork4.dll or QtNetworkd4.dll is located.

将libeay32.dll 和 ssleay32.dll 文件拷贝到QtSDK中的存放有QtNetwork4.dll和QtNetworkd4.dll的文件目录下。

原创粉丝点击