diff options
Diffstat (limited to 'Swiften/Session/BasicSessionStream.cpp')
| -rw-r--r-- | Swiften/Session/BasicSessionStream.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Swiften/Session/BasicSessionStream.cpp b/Swiften/Session/BasicSessionStream.cpp index 274d218..43f1c48 100644 --- a/Swiften/Session/BasicSessionStream.cpp +++ b/Swiften/Session/BasicSessionStream.cpp | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010-2014 Isode Limited. | 2 | * Copyright (c) 2010-2015 Isode Limited. |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * See the COPYING file for more information. | 4 | * See the COPYING file for more information. |
| 5 | */ | 5 | */ |
| @@ -27,14 +27,16 @@ BasicSessionStream::BasicSessionStream( | |||
| 27 | PayloadSerializerCollection* payloadSerializers, | 27 | PayloadSerializerCollection* payloadSerializers, |
| 28 | TLSContextFactory* tlsContextFactory, | 28 | TLSContextFactory* tlsContextFactory, |
| 29 | TimerFactory* timerFactory, | 29 | TimerFactory* timerFactory, |
| 30 | XMLParserFactory* xmlParserFactory) : | 30 | XMLParserFactory* xmlParserFactory, |
| 31 | const TLSOptions& tlsOptions) : | ||
| 31 | available(false), | 32 | available(false), |
| 32 | connection(connection), | 33 | connection(connection), |
| 33 | tlsContextFactory(tlsContextFactory), | 34 | tlsContextFactory(tlsContextFactory), |
| 34 | timerFactory(timerFactory), | 35 | timerFactory(timerFactory), |
| 35 | compressionLayer(NULL), | 36 | compressionLayer(NULL), |
| 36 | tlsLayer(NULL), | 37 | tlsLayer(NULL), |
| 37 | whitespacePingLayer(NULL) { | 38 | whitespacePingLayer(NULL), |
| 39 | tlsOptions_(tlsOptions) { | ||
| 38 | xmppLayer = new XMPPLayer(payloadParserFactories, payloadSerializers, xmlParserFactory, streamType); | 40 | xmppLayer = new XMPPLayer(payloadParserFactories, payloadSerializers, xmlParserFactory, streamType); |
| 39 | xmppLayer->onStreamStart.connect(boost::bind(&BasicSessionStream::handleStreamStartReceived, this, _1)); | 41 | xmppLayer->onStreamStart.connect(boost::bind(&BasicSessionStream::handleStreamStartReceived, this, _1)); |
| 40 | xmppLayer->onElement.connect(boost::bind(&BasicSessionStream::handleElementReceived, this, _1)); | 42 | xmppLayer->onElement.connect(boost::bind(&BasicSessionStream::handleElementReceived, this, _1)); |
| @@ -106,7 +108,7 @@ bool BasicSessionStream::supportsTLSEncryption() { | |||
| 106 | 108 | ||
| 107 | void BasicSessionStream::addTLSEncryption() { | 109 | void BasicSessionStream::addTLSEncryption() { |
| 108 | assert(available); | 110 | assert(available); |
| 109 | tlsLayer = new TLSLayer(tlsContextFactory); | 111 | tlsLayer = new TLSLayer(tlsContextFactory, tlsOptions_); |
| 110 | if (hasTLSCertificate() && !tlsLayer->setClientCertificate(getTLSCertificate())) { | 112 | if (hasTLSCertificate() && !tlsLayer->setClientCertificate(getTLSCertificate())) { |
| 111 | onClosed(boost::make_shared<SessionStreamError>(SessionStreamError::InvalidTLSCertificateError)); | 113 | onClosed(boost::make_shared<SessionStreamError>(SessionStreamError::InvalidTLSCertificateError)); |
| 112 | } | 114 | } |
Swift