QSslSocket error when SSL is not used

I noticed this conclusion in my two Qt applications that use QNetworkRequest to download some data from outside through QNeworkRequest:

QSslSocket: cannot resolve TLSv1_1_client_method QSslSocket: cannot resolve TLSv1_2_client_method QSslSocket: cannot resolve TLSv1_1_server_method QSslSocket: cannot resolve TLSv1_2_server_method QSslSocket: cannot resolve SSL_select_next_proto QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb QSslSocket: cannot resolve SSL_get0_next_proto_negotiated 

One example of a query that raises these warnings is

 QNetworkReply reply = m_nam->get(QNetworkRequest(QUrl("http://api.openweathermap.org/data/2.5/forecast?id=2835297&mode=xml"))); 

I am sure that in any of the requests there is no TLS / SSL, all this is simple HTTP. Messages always appear after the first request is sent, regardless of the URL. I have no intention of circumventing SSL at all, SSL is not mentioned in the code , which means that I cannot ignore warnings programmatically.

My setup is Windows 7 64 bit, MSVC2013 and MinGW, Qt 5.3.2. Messages appear regardless of the compiler used. No OpenSSL or other SSL development libraries installed.

And the question is: How do I get rid of these warnings?

+8
ssl qt qsslsocket
source share
4 answers

This is only from calling qWarning () when resolving OpenSSL functions. He does not try to name these functions, simply solving them. Calling unresolved functions will result in a QSslSocket: cannot call unresolved function ... warning.

The warning is the result of eliminating OpenSSL functions at run time by calling QSslSocket::supportsSsl() static in QNetworkAccessManager::supportedSchemesImplementation() , which returns supported schemes --- http and, if SSL https supported.

You have few options for these warnings,

  • ignore them because you don’t want or need SSL anyway
  • recompile Qt with -no-openssl passed to configure
  • sends OpenSSL, so functions are allowed and https becomes available - maybe not what you want
+15
source share

Sometimes customers had very similar warnings, but the software also crashed.

 QSslSocket: cannot resolve TLSv1_1_client_method QSslSocket: cannot resolve TLSv1_2_client_method QSslSocket: cannot resolve TLSv1_1_server_method QSslSocket: cannot resolve TLSv1_2_server_method QSslSocket: cannot resolve SSL_select_next_proto QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb QSslSocket: cannot resolve SSL_get0_next_proto_negotiated QMutex: destroying locked mutex 

We determined this because, although we also did not use SSL, the program found a copy of OpenSSL on the client computer and tried to contact it. The selected version was too old, though ( from Qt 5.2 onwards v1.0.0 or later is required).

Our solution was to distribute the OpenSSL DLL with our application (~ 1.65 MB). An alternative is to compile Qt from scratch without OpenSSL support.

+4
source share

You can disable the corresponding warning messages using QLoggingCategory::setFilterRules("qt.network.ssl.w arning=false");

+4
source share
+1
source share

All Articles