wim_til
wim_til

Reputation: 150

QT 5.13.0 Open ssl notworking mingw 7.3.0

I am trying to use QNetworkAccessManager with SSL but it is not working.

qDebug() << "Support SSL:  " << QSslSocket::supportsSsl()
            << "\nLib Version Number: " <<         QSslSocket::sslLibraryVersionNumber()
        << "\nLib Version String: " << QSslSocket::sslLibraryVersionString()
        << "\nLib Build Version Number: " << QSslSocket::sslLibraryBuildVersionNumber()
        << "\nLib Build Version String: " << QSslSocket::sslLibraryBuildVersionString();

Result is:

Support SSL:   false 
Lib Version Number:  0 
Lib Version String:  "" 
Lib Build Version Number:  269488175 
Lib Build Version String:  "OpenSSL 1.1.1b  26 Feb 2019"

I have tried to install openssl openssl-1.1.1c.tar.gz from https://www.openssl.org/source/ But this didn't work.

Upvotes: 1

Views: 989

Answers (2)

DaveKlassen
DaveKlassen

Reputation: 44

I followed this other reply downloading: https://bintray.com/vszakats/generic/openssl/1.1.1g and made sure the PATH binary location precedes System32 (ie. Windows). Everything worked fine. QT does document this:

https://doc.qt.io/qt-5/windows-requirements.html#ssl

One thing I noticed looking into this, QT does not like the cygwin version of OpenSSL (Windows apps rarely do). However if your using this legitimately(ie. non-test/dev) I would suggest you master your own installation of OpenSSL instead of relying on thirdparty compilations.

Upvotes: 1

yalov
yalov

Reputation: 575

https://doc.qt.io/qt-5/qsslsocket.html

QString QSslSocket::sslLibraryVersionString() Returns the version string of the SSL library in use. Note that this is the version of the library in use at run-time not compile time. If no SSL support is available then this will return an empty value.

QString QSslSocket::sslLibraryBuildVersionString() Returns the version string of the SSL library in use at compile time. If no SSL support is available then this will return an empty value.

So you have Qt with the OpenSSL, but you have not OpenSSL loaded correctly run-time.

You could use third party OpenSSL related binaries https://wiki.openssl.org/index.php/Binaries (or compile manually from the https://www.openssl.org/source/)

After installing, check that OpenSSL binaries are available for your application (added to the PATH), and you need to provide the OpenSSL binaries for your deployed application.

OpenSSL x64 v1.1 binaries are libcrypto-1_1-x64.dll and libssl-1_1-x64.dll

Upvotes: 1

Related Questions