Resolve the "Qt.network.ssl:QSslSocket:cannot resolve Sslv2_client_method" error that QT5 uses SSL

Source: Internet
Author: User

When a network component using QT connects to some servers, a "qt.network.ssl:QSslSocket:cannot resolve Sslv2_client_method" error is prompted, causing the connection to fail.

It was found that this is due to the SSLv2 due to some of the vulnerabilities caused by the security reasons, in some Linux distributions disabled SSLv2.

The solution is to recompile OpenSSL yourself, plus SSLv2 support

1. Download the code:

git clone https://github.com/openssl/openssl.git

2. Compiling

My test result is that openssl1.1 doesn't work, but openssl1.0 works

git checkout openssl_1_0_0-stable. /config enable-shared make depend make-j4

3. Copy compilation results to $qtdir/lib, my directory is /opt/qt5.7.0/5.7/gcc_64/lib/

sudo CP libcrypto.so libssl.so libcrypto.so. 1.0. 0 libssl.so. 1.0. 0 /opt/qt5.7.0/5.7/gcc_64/lib/

4. From the new application, Qt Pulgin will automatically load symbols from the newly compiled SSL libries

At this point you will still get some warning, such as

Qt.network.ssl:QSslSocket:cannot Resolve TLSv1_1_client_methodqt.network.ssl:QSslSocket:cannot Resolve tlsv1_2_ Client_methodqt.network.ssl:QSslSocket:cannot Resolve TLSv1_1_server_methodqt.network.ssl:QSslSocket:cannot Resolve TLSv1_2_server_methodqt.network.ssl:QSslSocket:cannot Resolve SSL_select_next_protoqt.network.ssl: Qsslsocket:cannot Resolve SSL_CTX_set_next_proto_select_cbqt.network.ssl:QSslSocket:cannot Resolve Ssl_get0_next_ Proto_negotiate

You can ignore it.

Resolve the "Qt.network.ssl:QSslSocket:cannot resolve Sslv2_client_method" error that QT5 uses SSL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.