Monday, November 16, 2009

[Solution] QSslSocket: cannot call unresolved function SSLv3_client_method

Problem

When you try to open a HTTPS URL with QSslSocket or QNetworkAccessManager class, you get the following errors:

QSslSocket: cannot call unresolved function SSLv3_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function ERR_get_error
QSslSocket: cannot call unresolved function ERR_error_string

Solution

You need to install OpenSSL Win32 or Win64 binaries.

  1. Open Win32 OpenSSL Installation Project page.
  2. Download the latest "light" Win32 or Win64 installation package, for example "Win32 OpenSSL v0.9.8l Light".
  3. Install it to any location. Ignore "Microsoft Visual C++ 2008 Redistributables" warning (click OK) and select copying OpenSSL DLLs to "The OpenSSL binaries (\bin) directory".
  4. Copy libeay32.dll and ssleay32.dll from the \bin folder to the same place where your QtNetwork4.dll or QtNetworkd4.dll is located.

18 comments:

  1. Found it useful, In linux if same error occurs you need to have libcrypto.so and libssl.so in your /usr/lib

    ReplyDelete
  2. Thx, I had problems with https and this fixed it, Good job sharing solution with others

    ReplyDelete
  3. @Systek, install OpenSSL for linux, than you need to have libcrypto.so and libssl.so in your /usr/lib. Just copy paste them!

    ReplyDelete
  4. It was really helpful. Thanks.

    ReplyDelete
  5. Hi,
    I'm trying to open a HTTPS URL with QSslSocket or QNetworkAccessManager but I haven't had success. Do you have a HOWTO o some guidance about it?
    Thanks

    ReplyDelete
  6. For Linux CentOS6 64bit, I resolved the error by doing the following:

    yum install openssl-devel.x86_64

    ReplyDelete
  7. i did all above things....
    But still now i found this errors...

    QSslSocket: cannot call unresolved function SSLv3_client_method
    QSslSocket: cannot call unresolved function SSL_CTX_new

    QSslSocket: cannot call unresolved function SSL_library_init
    QSslSocket: cannot call unresolved function ERR_get_error

    QSslSocket: cannot call unresolved function ERR_error_string

    when i trying to download a file through my own download manager devoloped by Qt...
    plz help...
    thankx in advanced...

    ReplyDelete
  8. Thanks a lot! That solved my problem :D

    ReplyDelete
  9. I do copy libcrypto.so and libssl.so in /usr/lib
    but it doesn't solve the problem

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. I don't have libeay32.dll and ssleay32.dll in bin folder

    ReplyDelete
    Replies
    1. Also i can't find tNetwork4.dll or QtNetworkd4.dll (5 versions too), but I use QT += network and it works

      Delete