Qt - Windows 上的 SLL 错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4348333/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 15:43:47  来源:igfitidea点击:

Qt - SLL error on Windows

windowsqtopensslmsvcr90d.dll

提问by Raphael

My app is throwing the following errors on windows:

我的应用程序在 Windows 上抛出以下错误:

QSslSocket: cannot call unresolved function SSLv3_client_method

QSslSocket:无法调用未解析的函数 SSLv3_client_method

QSslSocket: cannot call unresolved function SSL_CTX_new

QSslSocket:无法调用未解析的函数 SSL_CTX_new

QSslSocket: cannot call unresolved function SSL_library_init

QSslSocket:无法调用未解析的函数 SSL_library_init

QSslSocket: cannot call unresolved function ERR_get_error

QSslSocket:无法调用未解决的函数 ERR_get_error

QSslSocket: cannot call unresolved function ERR_error_string

QSslSocket:无法调用未解析的函数 ERR_error_string

I have already installed the VS C++ Redistributables and OpenSSL but I have no idea on how to tell Qt to link against openSSL dynamically. I'm using the LGPL version of the Qt binaries and Qt Creator all on Windows 7 (the Linux build works just fine)

我已经安装了 VS C++ Redistributables 和 OpenSSL,但我不知道如何告诉 Qt 动态链接 openSSL。我在 Windows 7 上使用 Qt 二进制文件和 Qt Creator 的 LGPL 版本(Linux 构建工作正常)

采纳答案by Raphael

For some reason Qt wasn't dealing very well with the dlls downloaded from Win32 OpenSSL Installation Project. As I had observed that the application ran smoothly on machines with Tortoise Svn installed I just copied the dlls provided with Tortoise and this worked very well for me.

出于某种原因,Qt 不能很好地处理从 Win32 OpenSSL 安装项目下载的 dll。正如我所观察到的应用程序在安装了 Tortoise Svn 的机器上运行流畅,我只是复制了 Tortoise 提供的 dll,这对我来说非常有效。

I know, it's weird that those dlls worked and those from the Win32 OpenSSL Installation Project didn't but for now copying the dlls from the Tortoise Svn installation folder solved my issue.

我知道,奇怪的是这些 dll 可以工作,而 Win32 OpenSSL 安装项目中的那些 dll 没有,但是现在从 Tortoise Svn 安装文件夹中复制 dll 解决了我的问题。

回答by gBIT

Download the the latest OpenSSL pre-build binaries from this website.

从此网站下载最新的 OpenSSL 预构建二进制文件。

I used Win32 OpenSSL v0.9.8r Lightas there is some debate about the v1 release. [Client tools are fine you don't need the full distribution]

我使用了Win32 OpenSSL v0.9.8r Light,因为关于 v1 版本存在一些争论。[客户端工具很好,你不需要完整的发行版]

Make sure that you install the dlls so that they are visible in the windows path. Either;

确保您安装了 dll,以便它们在 Windows 路径中可见。任何一个;

  • the windows / system32 directory
  • the application directory
  • or add the location of the dlls to the path enviroment variable
  • windows/system32目录
  • 应用程序目录
  • 或者将dll的位置添加到路径环境变量中

This works for me with Qt v4.6.2

这适用于 Qt v4.6.2