久久久久久久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 ()?環形?)
主站蜘蛛池模板: 免费视频99 | 亚洲三级免费看 | 久久国产视频播放 | 久久成人精品 | 欧美日韩在线精品 | 看毛片网站| 日本爱爱视频 | 天天射影院 | 亚洲精品乱码久久久久久蜜桃91 | 久久天天躁狠狠躁夜夜躁2014 | 一区二区三区精品在线 | 在线免费看黄 | 夫妻午夜影院 | 久久一二 | 日韩在线视频精品 | 久久人体视频 | 人人操日日干 | 国产免费一级片 | 欧美日日 | 精品久久久久久久久久 | 日韩成人国产 | 成人区精品一区二区婷婷 | 成人黄色在线视频 | 欧美 日韩 中文 | 成人网在线观看 | 欧美视频成人 | 成人av一区二区在线观看 | 一区二区中文 | 91免费看片| 一级看片免费视频 | 亚洲成人播放器 | 国产精品中文字幕在线 | 国产www成人 | 国产做a爱片久久毛片 | 91精品中文字幕一区二区三区 | 狠狠久久综合 | 国产日韩欧美在线 | 欧美日日 | 亚洲最大福利网 | 国产欧美日韩综合精品一区二区 | 欧美一区不卡 |