summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-11-09 20:57:36 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-11-09 21:41:52 (GMT)
commitd27e3cbf2c9c99cb989d641466f252c6277c78fe (patch)
tree38eb50b5bc7412276d5d4522c344d118f0aa32c1 /Swiften/Client
parente9be6f9bb696da4e1bcf750afd7015de4fe9220a (diff)
downloadswift-contrib-d27e3cbf2c9c99cb989d641466f252c6277c78fe.zip
swift-contrib-d27e3cbf2c9c99cb989d641466f252c6277c78fe.tar.bz2
Created CertificateFactory.
Diffstat (limited to 'Swiften/Client')
-rw-r--r--Swiften/Client/CoreClient.cpp8
-rw-r--r--Swiften/Client/CoreClient.h3
2 files changed, 6 insertions, 5 deletions
diff --git a/Swiften/Client/CoreClient.cpp b/Swiften/Client/CoreClient.cpp
index 7bde017..2c3ab35 100644
--- a/Swiften/Client/CoreClient.cpp
+++ b/Swiften/Client/CoreClient.cpp
@@ -11,7 +11,7 @@
#include "Swiften/Network/MainBoostIOServiceThread.h"
#include "Swiften/Network/BoostIOServiceThread.h"
#include "Swiften/Client/ClientSession.h"
-#include "Swiften/TLS/PlatformTLSContextFactory.h"
+#include "Swiften/TLS/PlatformTLSFactories.h"
#include "Swiften/TLS/CertificateVerificationError.h"
#include "Swiften/Network/Connector.h"
#include "Swiften/Network/BoostConnectionFactory.h"
@@ -34,14 +34,14 @@ CoreClient::CoreClient(EventLoop* eventLoop, const JID& jid, const String& passw
iqRouter_ = new IQRouter(stanzaChannel_);
connectionFactory_ = new BoostConnectionFactory(&MainBoostIOServiceThread::getInstance().getIOService(), eventLoop);
timerFactory_ = new BoostTimerFactory(&MainBoostIOServiceThread::getInstance().getIOService(), eventLoop);
- tlsContextFactory_ = new PlatformTLSContextFactory();
+ tlsFactories = new PlatformTLSFactories();
}
CoreClient::~CoreClient() {
if (session_ || connection_) {
std::cerr << "Warning: Client not disconnected properly" << std::endl;
}
- delete tlsContextFactory_;
+ delete tlsFactories;
delete timerFactory_;
delete connectionFactory_;
delete iqRouter_;
@@ -82,7 +82,7 @@ void CoreClient::handleConnectorFinished(boost::shared_ptr<Connection> connectio
connection_ = connection;
assert(!sessionStream_);
- sessionStream_ = boost::shared_ptr<BasicSessionStream>(new BasicSessionStream(ClientStreamType, connection_, &payloadParserFactories_, &payloadSerializers_, tlsContextFactory_, timerFactory_));
+ sessionStream_ = boost::shared_ptr<BasicSessionStream>(new BasicSessionStream(ClientStreamType, connection_, &payloadParserFactories_, &payloadSerializers_, tlsFactories->getTLSContextFactory(), timerFactory_));
if (!certificate_.isEmpty()) {
sessionStream_->setTLSCertificate(PKCS12Certificate(certificate_, password_));
}
diff --git a/Swiften/Client/CoreClient.h b/Swiften/Client/CoreClient.h
index 780201d..211f84f 100644
--- a/Swiften/Client/CoreClient.h
+++ b/Swiften/Client/CoreClient.h
@@ -32,6 +32,7 @@ namespace Swift {
class ClientSession;
class BasicSessionStream;
class EventLoop;
+ class PlatformTLSFactories;
class CertificateTrustChecker;
/**
@@ -201,7 +202,7 @@ namespace Swift {
Connector::ref connector_;
ConnectionFactory* connectionFactory_;
TimerFactory* timerFactory_;
- TLSContextFactory* tlsContextFactory_;
+ PlatformTLSFactories* tlsFactories;
FullPayloadParserFactoryCollection payloadParserFactories_;
FullPayloadSerializerCollection payloadSerializers_;
boost::shared_ptr<Connection> connection_;