summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-11-07 20:07:06 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-11-07 21:27:17 (GMT)
commita594eb3fef7e047d1eca7959d7734d4d10fd1eb7 (patch)
treef0c75a890caf231e18c963e6485d8c3fcf418324 /Swift
parent8cfb6d8f3492dd4180429f37dfb463b2fa48b0b8 (diff)
downloadswift-contrib-a594eb3fef7e047d1eca7959d7734d4d10fd1eb7.zip
swift-contrib-a594eb3fef7e047d1eca7959d7734d4d10fd1eb7.tar.bz2
Refactoring certificates & certificate checking.
Diffstat (limited to 'Swift')
-rw-r--r--Swift/Controllers/MainController.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index 093f987..cc51ec3 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -356,6 +356,7 @@ void MainController::performLoginFromCachedCredentials() {
if (!client_) {
storages_ = storagesFactory_->createStorages(jid_);
client_ = new Swift::Client(eventLoop_, jid_, password_, storages_);
+ client_->setAlwaysTrustCertificates();
client_->onDataRead.connect(boost::bind(&XMLConsoleController::handleDataRead, xmlConsoleController_, _1));
client_->onDataWritten.connect(boost::bind(&XMLConsoleController::handleDataWritten, xmlConsoleController_, _1));
client_->onDisconnected.connect(boost::bind(&MainController::handleDisconnected, this, _1));
@@ -416,6 +417,19 @@ void MainController::handleDisconnected(const boost::optional<ClientError>& erro
case ClientError::TLSError: message = "Encryption error"; break;
case ClientError::ClientCertificateLoadError: message = "Error loading certificate (Invalid password?)"; break;
case ClientError::ClientCertificateError: message = "Certificate not authorized"; break;
+
+ case ClientError::UnknownCertificateError:
+ case ClientError::CertificateExpiredError:
+ case ClientError::CertificateNotYetValidError:
+ case ClientError::CertificateSelfSignedError:
+ case ClientError::CertificateRejectedError:
+ case ClientError::CertificateUntrustedError:
+ case ClientError::InvalidCertificatePurposeError:
+ case ClientError::CertificatePathLengthExceededError:
+ case ClientError::InvalidCertificateSignatureError:
+ case ClientError::InvalidCAError:
+ // TODO
+ message = "Certificate error"; break;
}
if (!rosterController_) { //hasn't been logged in yet
signOut();