Qt error message “qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed”

前端 未结 3 1173
面向向阳花
面向向阳花 2021-01-22 04:18

I get the following error when I try to run my Qt application:

qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
qt.net

3条回答
  •  遇见更好的自我
    2021-01-22 05:14

    Based on the information provided on the question, it looks like you have installed a too recent OpenSSL version. In fact I already had the same issue.

    As you've found out, Qt does not embed OpenSSL. What you have to do is to install it by yourself. But you should ensure that you have the same (or the closest) version of OpenSSL than the one used for the Qt build.

    • You can check what version of OpenSSL was used for the Qt build with:
    qDebug() << QSslSocket::sslLibraryBuildVersionString();
    
    • You can check if SSL is supported with:
    qDebug() << QSslSocket::supportsSsl();
    
    • You can check what version you have with:
    qDebug() << QSslSocket::sslLibraryVersionString();
    

    Note: Don't forget to include the install directory to the PATH environment variable to make the dlls accessible (or copy the dlls).


    Let me know if it does not solve your issue so that I can remove this answer to avoid unnecessary noise.

提交回复
热议问题