Here is a part of httpwindow.cpp from Qt Examples:
#ifndef QT_NO_OPENSSL
void HttpWindow::sslErrors(const QList<QSslError> &errors)
{
foreach (const QSslError &error, errors) {
if (!errorString.isEmpty())
errorString += ", ";
errorString += error.errorString();
}
tr("One or more SSL errors has occurred: %1").arg(errorString),
http->ignoreSslErrors();
}
}
#endif
#ifndef QT_NO_OPENSSL
void HttpWindow::sslErrors(const QList<QSslError> &errors)
{
QString errorString;
foreach (const QSslError &error, errors) {
if (!errorString.isEmpty())
errorString += ", ";
errorString += error.errorString();
}
if (QMessageBox::warning(this, tr("HTTP Example"),
tr("One or more SSL errors has occurred: %1").arg(errorString),
QMessageBox::Ignore | QMessageBox::Abort) == QMessageBox::Ignore) {
http->ignoreSslErrors();
}
}
#endif
To copy to clipboard, switch view to plain text mode
as you see it's surrounded by
#ifndef QT_NO_OPENSSL
// . . .
#endif
#ifndef QT_NO_OPENSSL
// . . .
#endif
To copy to clipboard, switch view to plain text mode
so if you compile Qt without SSL support then this example still work but can't handle SSL connections (QT_NO_OPENSSL will be defined so that code would be, let's say, cut out). You said that you need to download files from server with SSL - and it's not working, but it's working for non-SSL connections, so the reason would be in QT_NO_OPENSSL is defined == Qt built without OpenSSL.
Bookmarks