Monday, September 5, 2022

[SOLVED] Qt and OpenSSL incompatible version on Ubuntu

Issue

I am having issues trying to make QNetwork classes work with Qt5.11.1 on Ubuntu 18.04

I have openssl 1.1.0g and libssl-dev installed on my system.

The openssl version used by Qt is 1.0.2k. I have checked with QSslSocket::sslLibraryBuildVersionString(). Plus QSslSocket::supportsSsl() returns false.

I am trying to get my head around this but I am always having these errors:

qt.network.ssl: QSslSocket: cannot resolve CRYPTO_num_locks
qt.network.ssl: QSslSocket: cannot resolve CRYPTO_set_id_callback
qt.network.ssl: QSslSocket: cannot resolve CRYPTO_set_locking_callback
qt.network.ssl: QSslSocket: cannot resolve ERR_free_strings
qt.network.ssl: QSslSocket: cannot resolve EVP_CIPHER_CTX_cleanup
qt.network.ssl: QSslSocket: cannot resolve EVP_CIPHER_CTX_init
qt.network.ssl: QSslSocket: cannot resolve sk_new_null
qt.network.ssl: QSslSocket: cannot resolve sk_push
qt.network.ssl: QSslSocket: cannot resolve sk_free
qt.network.ssl: QSslSocket: cannot resolve sk_num
qt.network.ssl: QSslSocket: cannot resolve sk_pop_free
qt.network.ssl: QSslSocket: cannot resolve sk_value
qt.network.ssl: QSslSocket: cannot resolve SSL_library_init
qt.network.ssl: QSslSocket: cannot resolve SSL_load_error_strings
qt.network.ssl: QSslSocket: cannot resolve SSL_get_ex_new_index
qt.network.ssl: QSslSocket: cannot resolve SSLv3_client_method
qt.network.ssl: QSslSocket: cannot resolve SSLv23_client_method
qt.network.ssl: QSslSocket: cannot resolve SSLv3_server_method
qt.network.ssl: QSslSocket: cannot resolve SSLv23_server_method
qt.network.ssl: QSslSocket: cannot resolve X509_STORE_CTX_get_chain
qt.network.ssl: QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
qt.network.ssl: QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
qt.network.ssl: QSslSocket: cannot resolve SSLeay
qt.network.ssl: Incompatible version of OpenSSL

I have checked multiple questions and forums about that and nothing seems to work for me. Anybody got any idea?


Solution

I have finally managed to make it work.

I have installed openssl 1.0.2k from the sources. I have downloaded the version I needed here and followed the tutorial on this page.

After doing so I was still having some of the errors but not the ones for the incompatible version. To fix that I have installed libssl1.0-dev and everything was good to go (thx to this guy).

I hope this will help somebody.



Answered By - guillaumegoui
Answer Checked By - Candace Johnson (WPSolving Volunteer)