diff options
Diffstat (limited to 'Swiften/Session')
-rw-r--r-- | Swiften/Session/BasicSessionStream.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Swiften/Session/BasicSessionStream.cpp b/Swiften/Session/BasicSessionStream.cpp index 10c6ad0..54cd225 100644 --- a/Swiften/Session/BasicSessionStream.cpp +++ b/Swiften/Session/BasicSessionStream.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2016 Isode Limited. + * Copyright (c) 2010-2018 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -111,7 +111,8 @@ bool BasicSessionStream::supportsTLSEncryption() { void BasicSessionStream::addTLSEncryption() { assert(available); - tlsLayer = new TLSLayer(tlsContextFactory, tlsOptions_); + auto tlsContext = tlsContextFactory->createTLSContext(tlsOptions_); + tlsLayer = new TLSLayer(std::move(tlsContext)); if (hasTLSCertificate() && !tlsLayer->setClientCertificate(getTLSCertificate())) { onClosed(std::make_shared<SessionStreamError>(SessionStreamError::InvalidTLSCertificateError)); } |