diff options
Diffstat (limited to 'jobs')
-rw-r--r-- | jobs/basejob.cpp | 11 | ||||
-rw-r--r-- | jobs/basejob.h | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp index b7e1b718..86109feb 100644 --- a/jobs/basejob.cpp +++ b/jobs/basejob.cpp @@ -97,6 +97,7 @@ void BaseJob::start() d->reply = d->connection->nam()->put(req, data.toJson()); break; } + connect( d->reply, &QNetworkReply::sslErrors, this, &BaseJob::sslErrors ); connect( d->reply, &QNetworkReply::finished, this, &BaseJob::gotReply ); QTimer::singleShot( 120*1000, this, SLOT(timeout()) ); // connect( d->reply, static_cast<void(QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error), @@ -124,7 +125,7 @@ void BaseJob::gotReply() { if( d->reply->error() != QNetworkReply::NoError ) { - qDebug() << "NetworkError!!!"; + qDebug() << "NetworkError:" << d->reply->errorString(); fail( NetworkError, d->reply->errorString() ); return; } @@ -144,3 +145,11 @@ void BaseJob::timeout() if( d->reply->isRunning() ) d->reply->abort(); } + +void BaseJob::sslErrors(const QList<QSslError>& errors) +{ + foreach (const QSslError &error, errors) { + qWarning() << "SSL ERROR" << error.errorString(); + } + d->reply->ignoreSslErrors(); // TODO: insecure! should prompt user first +} diff --git a/jobs/basejob.h b/jobs/basejob.h index 88911ca1..95cf4232 100644 --- a/jobs/basejob.h +++ b/jobs/basejob.h @@ -63,6 +63,7 @@ namespace QMatrixClient protected slots: virtual void gotReply(); void timeout(); + void sslErrors(const QList<QSslError>& errors); //void networkError(QNetworkReply::NetworkError code); |