Project scenario:
QT network programming appears when requesting the website: qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
Problem description
Cause analysis:
The computer may not have the correct OpenSSL installed.
Solution:
1. we use the following code to determine the OpenSSL version our QT support
#include <QSslSocket>
#include <QDebug>
qDebug()<< QSslSocket::sslLibraryBuildVersionString();
My output here is:
you can see that my OpenSSL version is bit 1.1.1. Download the corresponding version of OpenSSL
2. on this website: http://slproweb.com/products/Win32OpenSSL.html Download the corresponding OpenSSL version. One thing to note is: if you use MinGW 32-bit kit, Download
otherwise, if you use MinGW 64 bit kit, Download win64 OpenSSL. Note that both compilers only need to download the EXE executable of the light version.
3. Install OpenSSL
click next all the time. In the last step, set the folder to bin.
4. Copy the file
I downloaded the Win64 version of OpenSSL here. Therefore, copy the libcrypto-1_1-x64.dll and libssl-1_1-x64.dll files in the OpenSSL folder to the qt installation directory. The specific directory is here: D:\Qt\Qt5.14.0\5.14.0\ mingw73_64\bin. If you download 32-bit, you only need to put it in the D:\Qt\Qt5.14.0\5.14.0\mingw73_32\bin directory, and the others are similar.
5. Ends
if you run the project file again, QT will not report the error: qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
Read More:
- How to Solve Msys2/mingw64 Run cmake GUI Error
- [Solved] error: Failed dependencies libcrypto.so.10()(64bit) is needed, libssl.so.10()(64bit) is needed
- How to Solve QT and PCIe interactive loading setupapi.H error
- [Go] Solve the problem of exec: “gcc” executable file not found in %PATH% error when using cgo
- Clion new method shows undefined reference to solution
- Error: Error building SqlSession [How to Solve]
- [Solved] CMake Error: Error: generator : Unix Makefiles
- How to Solve svn error: WC DB
- ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’
- [Solved] error:#20: identifier “HAL_StatusTypeDef“ is undefined.
- [Solved] pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available
- Oracle Start as DBA Error [How to Solve]
- OpenSSL: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failur
- Analysis of npm error ENOTFOUND npm ERR! network request to https://npm.***.com/*** failed and the role of the .npmrc file
- [Solved] Hive 2.3.9 Error: Error: Unrecognized column type: UNIONTYPE (state=,code=0)
- [Solved] Failed to resolve: com.serenegiant:common:1.5.20
- [Solved] The Ruby zlib extension was not compiled
- How to Solve Excel Error Log 0: Install Error
- Vue-element-admin Use npm install Error: npm ERR! Error while executing:
- [Solved] fatal error C1083: Could Not Open Unable to open include file:“stdint.h”: No such file or directory