PDA

View Full Version : QNetworkAccessManager::get generates SSL qWarning output when no SSL is used



don@thegagnes.com
5th April 2015, 22:25
I have a call to QNetworkAccessManager::get which eventually works it's way down to q_resolveOpenSslSymbols in the Qt source. The code in q_resolveOpenSslSymbols outputs warnings if some of the SSL library routines are missing. On OS X the SSL library is older and some of these routines are missing so you get the warnings. My application does not use any SSL connections. But even given that, there does not seem to be any way to not hit these qWarnings. We develop and run unit tests with QT_FATAL_WARNINGS always set to catch issues and keep our code as clean as possible. This prevents anyone using QNetworkAccessManager and not using SSL from using QT_FATAL_WARNINGS in their testing since it hits false positive failures. Is their any way around this?

Added after 12 minutes:

Should have said that I'm using 5.4.0 which I think is when this problem started. Internet searches on the qWarning output can find many cases where other people are hitting this. But they are just ignoring it. With QT_FATAL_WARNINGS set I'm stuck not being able to ignore it.

jefftee
6th April 2015, 00:40
I had the same messages starting with 5.4.0. Only way I know to get rid of the warnings is to rebuild Qt on your system. Not sure if the problem exists in 5.4.1 though since I compiled my own version right out of the chute (for another reason altogether).

Edit: I should add that I have openssl 1.0.2a installed via macports, which is why building Qt 5.4.1 from source does not show these warnings.

don@thegagnes.com
10th April 2015, 22:54
Here is the answer:

From Qt 5.4.1 onwards you can disable the warning by e.g. setting
QT_LOGGING_RULES=qt.network.ssl.warning=false
in the environment, or calling
QLoggingCategory::setFilterRules("qt.network.ssl.warning=false");
in your main().