summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2014-08-27 14:16:15 (GMT)
committerKevin Smith <kevin.smith@isode.com>2015-06-10 20:29:05 (GMT)
commitb2093a372874aefb4f56f66a70a96f78d6cbbaec (patch)
treeab779a4cc7950339d2c2cb0261ae6a08df84c645 /Swiften/Client
parentb6b0695643f932827add43b9de0e09ed74eb6799 (diff)
downloadswift-b2093a372874aefb4f56f66a70a96f78d6cbbaec.zip
swift-b2093a372874aefb4f56f66a70a96f78d6cbbaec.tar.bz2
Add ability to limit SChannel to TLS 1.0
Some servers have very restrictive TLS stacks that respond badly to a bug in the SChannel TLS implementation, meaning that TLS has to be limited to 1.0. Add ClientOptions.tlsOptions. This is a method of passing options into the TLS stack. It's currently only used for the TLS 1.0 workaround in SChannel, but we might reasonably expose other options in the future, such as limiting cypher suites. Disables use of SSLv3 for SChannel Also updates the coding style in SchannelContext a bit. Test-Information: Compiles on both OS X and Windows(SChannel). OS X doesn't show the new option. Windows shows it, and remembers it between logins. Not tested against a server requiring 1.0 only, but a previous hack with the same approach was tested. Change-Id: I1e7854d43811fd173f21f98d4dc3915fc7a4b322
Diffstat (limited to 'Swiften/Client')
-rw-r--r--Swiften/Client/ClientOptions.h7
-rw-r--r--Swiften/Client/CoreClient.cpp5
2 files changed, 10 insertions, 2 deletions
diff --git a/Swiften/Client/ClientOptions.h b/Swiften/Client/ClientOptions.h
index 4aac609..25393e4 100644
--- a/Swiften/Client/ClientOptions.h
+++ b/Swiften/Client/ClientOptions.h
@@ -11,6 +11,8 @@
11#include <Swiften/Base/API.h> 11#include <Swiften/Base/API.h>
12#include <Swiften/Base/URL.h> 12#include <Swiften/Base/URL.h>
13#include <Swiften/Base/SafeString.h> 13#include <Swiften/Base/SafeString.h>
14#include <Swiften/TLS/TLSOptions.h>
15
14 16
15namespace Swift { 17namespace Swift {
16 class HTTPTrafficFilter; 18 class HTTPTrafficFilter;
@@ -145,5 +147,10 @@ namespace Swift {
145 * proxy initialization to be customized. 147 * proxy initialization to be customized.
146 */ 148 */
147 boost::shared_ptr<HTTPTrafficFilter> httpTrafficFilter; 149 boost::shared_ptr<HTTPTrafficFilter> httpTrafficFilter;
150
151 /**
152 * Options passed to the TLS stack
153 */
154 TLSOptions tlsOptions;
148 }; 155 };
149} 156}
diff --git a/Swiften/Client/CoreClient.cpp b/Swiften/Client/CoreClient.cpp
index 842488d..c91e5c5 100644
--- a/Swiften/Client/CoreClient.cpp
+++ b/Swiften/Client/CoreClient.cpp
@@ -138,7 +138,8 @@ void CoreClient::connect(const ClientOptions& o) {
138 host, 138 host,
139 options.boshHTTPConnectProxyURL, 139 options.boshHTTPConnectProxyURL,
140 options.boshHTTPConnectProxyAuthID, 140 options.boshHTTPConnectProxyAuthID,
141 options.boshHTTPConnectProxyAuthPassword)); 141 options.boshHTTPConnectProxyAuthPassword,
142 options.tlsOptions));
142 sessionStream_->onDataRead.connect(boost::bind(&CoreClient::handleDataRead, this, _1)); 143 sessionStream_->onDataRead.connect(boost::bind(&CoreClient::handleDataRead, this, _1));
143 sessionStream_->onDataWritten.connect(boost::bind(&CoreClient::handleDataWritten, this, _1)); 144 sessionStream_->onDataWritten.connect(boost::bind(&CoreClient::handleDataWritten, this, _1));
144 bindSessionToStream(); 145 bindSessionToStream();
@@ -189,7 +190,7 @@ void CoreClient::handleConnectorFinished(boost::shared_ptr<Connection> connectio
189 connection_ = connection; 190 connection_ = connection;
190 191
191 assert(!sessionStream_); 192 assert(!sessionStream_);
192 sessionStream_ = boost::make_shared<BasicSessionStream>(ClientStreamType, connection_, getPayloadParserFactories(), getPayloadSerializers(), networkFactories->getTLSContextFactory(), networkFactories->getTimerFactory(), networkFactories->getXMLParserFactory()); 193 sessionStream_ = boost::make_shared<BasicSessionStream>(ClientStreamType, connection_, getPayloadParserFactories(), getPayloadSerializers(), networkFactories->getTLSContextFactory(), networkFactories->getTimerFactory(), networkFactories->getXMLParserFactory(), options.tlsOptions);
193 if (certificate_ && !certificate_->isNull()) { 194 if (certificate_ && !certificate_->isNull()) {
194 sessionStream_->setTLSCertificate(certificate_); 195 sessionStream_->setTLSCertificate(certificate_);
195 } 196 }