PDA

View Full Version : Ssl error messages in console application



TorAn
27th November 2017, 04:39
I have a simple console app test (win32) that produces ssl errors in the console, even though I do not use ssl
Errors:
qt.network.ssl: QSslSocket: cannot call unresolved function d2i_DHparams
qt.network.ssl: QSslSocket: cannot call unresolved function DH_free


int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);

QNetworkAccessManager mgr;
if (! QObject::connect(&mgr, &QNetworkAccessManager::sslErrors, [&](QNetworkReply * reply, const QList<QSslError>&)
{
reply->ignoreSslErrors();
}))
{
return 0;
}

QString str = QString("%1apiData.ashx?t=%2&d=%3").arg("localhost:8080/").arg(1).arg(2);
QNetworkRequest req(QUrl(QString("%1").arg(str)));
mgr.get(req);

return a.exec();
}

Pro file:

QT += core network xml
QT -= gui

CONFIG += c++11
CONFIG += console
CONFIG -= app_bundle
DEFINES += QT_DEPRECATED_WARNINGS QT_LARGEFILE_SUPPORT QT_XML_LIB QT_NETWORK_LIB

What could be the problem? My other non-console apps do not produce these errors.

Thanks!