久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在 Qt C++ 中使用 OpenSSL

Use OpenSSL in Qt C++(在 Qt C++ 中使用 OpenSSL)
本文介紹了在 Qt C++ 中使用 OpenSSL的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我得到了一個示例項目,它使用 QSslSocketQSslCertificate 從 SSL 證書(Qt 5.7、Windows 10)獲取信息.QSslSocket::supportsSsl() 函數返回 false,我在運行時收到這些錯誤:

I got a sample projct that uses QSslSocket and QSslCertificate to get information from a SSL certificate (Qt 5.7, Windows 10). QSslSocket::supportsSsl() function returns false and I get these errors at runtime:

qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error

所以我編譯了 OpenSSL_1.1.0 并將其鏈接到我的項目:

So I compiled OpenSSL_1.1.0 and linked it to my project:

INCLUDEPATH += . "C:/OpenSSL-Win32/include/" LIBS +=
-L"C:/OpenSSL-Win32/lib/" -llibcrypto -llibssl

但還是一樣的錯誤.我下載了 OpenSSL 安裝程序,但還是一樣.

But still same errors. I downloaded OpenSSL installer and still the same.

奇怪的是 QSslSocket::sslLibraryBuildVersionString() 返回 OpenSSL 1.0.2g 1 Mar 2016,即使我編譯并安裝了 OpenSSL_1.1.0.

Weird is QSslSocket::sslLibraryBuildVersionString() returns OpenSSL 1.0.2g 1 Mar 2016, even though I compiled and installed OpenSSL_1.1.0.

我知道我遺漏了一個簡單的細節.請告訴我是什么.謝謝.

I know I'm missing a simple detail. Please tell me what is it. Thanks.

推薦答案

來自文檔:

QSslSocket::sslLibraryBuildVersionString() 返回 SSL 庫的版本字符串在編譯時使用.(強調我的)

QSslSocket::sslLibraryBuildVersionString() Returns the version string of the SSL library in use at compile time. (emphasis mine)

你從它得到結果并不意味著 Qt 可以訪問 OpenSSL,只是它是針對某個版本編譯的.這讓您知道如果動態鏈接(默認情況下),您應該在運行時提供哪個二進制兼容版本.

That you get a result from it doesn't mean that Qt has access to OpenSSL, only that it was compiled against a certain version. That lets you know what binary-compatible version you should provide at runtime if it's dynamically linked (as it is by default).

您想檢查 QSslSocket::sslLibraryVersionNumber() - [...] 庫的版本在運行時使用(重點是我的).

You want to check QSslSocket::sslLibraryVersionNumber() - [...] the version of the library in use at run-time (emphasis mine).

Qt 可能會嘗試在 PATH 中找到 OpenSSL dll 的副本,如果沒有,則在 QCoreApplication::libraryPaths 給出的路徑中.在嘗試使用 OpenSSL 之前,您應該將 OpenSSL dll 的位置添加到其中之一.

Qt will presumably attempt to find a copy of OpenSSL dlls in PATH, and if not, in the paths given by QCoreApplication::libraryPaths. You should add the location of OpenSSL dlls to either one before attempting to use OpenSSL.

這篇關于在 Qt C++ 中使用 OpenSSL的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How can I read and manipulate CSV file data in C++?(如何在 C++ 中讀取和操作 CSV 文件數據?)
In C++ why can#39;t I write a for() loop like this: for( int i = 1, double i2 = 0; (在 C++ 中,為什么我不能像這樣編寫 for() 循環: for( int i = 1, double i2 = 0;)
How does OpenMP handle nested loops?(OpenMP 如何處理嵌套循環?)
Reusing thread in loop c++(在循環 C++ 中重用線程)
Precise thread sleep needed. Max 1ms error(需要精確的線程睡眠.最大 1ms 誤差)
Is there ever a need for a quot;do {...} while ( )quot; loop?(是否需要“do {...} while ()?環形?)
主站蜘蛛池模板: 日韩免费视频一区二区 | 看逼网站 | 成人免费在线视频观看 | 久久国内精品 | 午夜av在线播放 | 精品国产99久久久久久宅男i | 可以在线观看的av | 精品在线免费视频 | 久久这里有精品 | 日韩av一区二区在线观看 | 97国产在线| 免费看黄色录像 | 手机av免费 | 在线一区| 91福利在线观看 | 一级片免费播放 | 热久久中文字幕 | 国产精品一二三四 | 黄色成人小视频 | 国产精品三级视频 | 国产女人水真多18毛片18精品 | 91国产丝袜在线播放 | 国产一区二区在线免费 | 黄色一级大片 | 日日爱视频 | 看一级黄色片 | 亚洲欧美视频 | 美日韩一区二区三区 | 国产一区在线播放 | 日批视频网站 | 日韩欧美网站 | 精品一区av | 毛片毛片毛片毛片毛片 | 97在线播放 | 免费的黄色小视频 | 欧美日韩亚洲一区二区 | av香蕉 | 日韩免费高清 | 日韩欧美网站 | 亚洲精品乱码久久久久久动漫 | 日韩在线免费观看视频 |