简体   繁体   中英

QSslSocket errors

In Qt 4.8 on Windows 7 Ultimate x64, when I try to use QNetworkAccessManager to post() something over the network:

_net_acc_mgr.post(QNetworkRequest(QUrl(...)),
                  QByteArray(...));

I encounter the following run time errors:

QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
QSslSocket: cannot call unresolved function OPENSSL_add_all_algorithms_noconf
content-type missing in HTTP POST, defaulting to application/octet-stream

I clearly remember the same code worked couple of years ago. But I forget which version of Qt I tried.

Is there anything else require to work with QNetworkAccessManager in Qt 4.8?

  • The QT runs on 32bit

  • In Windows 64bit the folder system32 does not have the DLLs required for OpenSSL , only there in sysWOW64 folder .

  • To resolve this you will need to install the binary version of OpenSSL 32 .

Download compiled for Windows (Update link):

http://slproweb.com/download/Win32OpenSSL_Light-1_0_1g.exe

Note: During install select the option "The OpenSSL binaries (/bin) directory" (Probably C:\\OpenSSL-Win32 )

After install copy DLLs (from C:\\OpenSSL-32 or %HOMEDRIVE%\\OpenSSL-32 ) for release/debug project folder:

  • libeay32.dll
  • libssl32.dll
  • ssleay32.dll

Another option would be to use the Mingw 64bit , but do not know if this would be feasible with the QT (this case, if you can compile the application will run only on 64bit systems).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM