diff options
author | alex-z <blackslayer4@gmail.com> | 2021-12-16 19:23:03 +0300 |
---|---|---|
committer | alex-z <blackslayer4@gmail.com> | 2021-12-16 19:23:03 +0300 |
commit | 8fe76b0cdd1a58a65e70f24e225ca69bb1bd1a73 (patch) | |
tree | 2dd871b961890a3c9f3c36203abe73ea18d929a2 | |
parent | a5275e37d191f3911516220ccf1c45778476e437 (diff) |
Test. Relogin on SSL handshake errors.feature/test-ssl-errors-relogin
Signed-off-by: alex-z <blackslayer4@gmail.com>
-rw-r--r-- | src/gui/accountstate.cpp | 13 | ||||
-rw-r--r-- | src/gui/connectionvalidator.cpp | 2 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp index 7521dac79..0e4e999c5 100644 --- a/src/gui/accountstate.cpp +++ b/src/gui/accountstate.cpp @@ -223,10 +223,21 @@ void AccountState::setDesktopNotificationsAllowed(bool isAllowed) void AccountState::checkConnectivity() { - if (isSignedOut() || _waitingForNewCredentials) { + if (_waitingForNewCredentials) { return; } + if (isSignedOut()) { + qCWarning(lcAccountState) << "Account is signed-out, but, we're going to try to sign in again."; + qCWarning(lcAccountState) << "_connectionErrors are:" << _connectionErrors; + qCWarning(lcAccountState) << "_connectionStatus is:" << _connectionStatus; + if (account()) { + account()->resetRejectedCertificates(); + signIn(); + return; + } + } + if (_connectionValidator) { qCWarning(lcAccountState) << "ConnectionValidator already running, ignoring" << account()->displayName(); return; diff --git a/src/gui/connectionvalidator.cpp b/src/gui/connectionvalidator.cpp index 159333544..14bc2617c 100644 --- a/src/gui/connectionvalidator.cpp +++ b/src/gui/connectionvalidator.cpp @@ -136,7 +136,7 @@ void ConnectionValidator::slotStatusFound(const QUrl &url, const QJsonObject &in void ConnectionValidator::slotNoStatusFound(QNetworkReply *reply) { auto job = qobject_cast<CheckServerJob *>(sender()); - qCWarning(lcConnectionValidator) << reply->error() << job->errorString() << reply->peek(1024); + qCWarning(lcConnectionValidator) << reply->error() << reply->errorString() << job->errorString() << reply->peek(1024); if (reply->error() == QNetworkReply::SslHandshakeFailedError) { reportResult(SslError); return; |