summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTarun Gupta <tarun1995gupta@gmail.com>2015-07-24 17:01:42 (GMT)
committerNick Hudson <nick.hudson@isode.com>2015-08-14 15:32:08 (GMT)
commit0a1f7199e26523dd2693f44a5841c5434cc9000d (patch)
tree8f28ebb20fbe60f420ea25055955ac3d246db549 /src/com/isode/stroke/client/CoreClient.java
parentdc2b35bee48261e8b06e12bd82a434af118e035e (diff)
downloadstroke-0a1f7199e26523dd2693f44a5841c5434cc9000d.zip
stroke-0a1f7199e26523dd2693f44a5841c5434cc9000d.tar.bz2
Completes TLS & Session.
Adds TLSError and TLSOptions. Updates BasicSessionStream, SessionStream and Session. Updates Client and Components to accomodate changes in TLS. Also completes TLSLayer in StreamStack which was pending due to TLS port. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for Certificate and ServerIdentityVerifier. Test updated for ComponentSession. All tests pass. Change-Id: I34a8fe068c1e8af5348cc4ab49d3d1ed118ae833
Diffstat (limited to 'src/com/isode/stroke/client/CoreClient.java')
-rw-r--r--src/com/isode/stroke/client/CoreClient.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/isode/stroke/client/CoreClient.java b/src/com/isode/stroke/client/CoreClient.java
index 39229a3..74ba031 100644
--- a/src/com/isode/stroke/client/CoreClient.java
+++ b/src/com/isode/stroke/client/CoreClient.java
@@ -29,6 +29,7 @@ import com.isode.stroke.signals.Slot2;
import com.isode.stroke.tls.CertificateTrustChecker;
import com.isode.stroke.tls.CertificateVerificationError;
import com.isode.stroke.tls.CertificateWithKey;
+import com.isode.stroke.tls.TLSOptions;
/**
* The central class for communicating with an XMPP server.
@@ -246,7 +247,7 @@ public class CoreClient {
connection_ = connection;
assert (sessionStream_ == null);
- sessionStream_ = new BasicSessionStream(StreamType.ClientStreamType, connection_, payloadParserFactories_, payloadSerializers_, networkFactories.getTLSContextFactory(), networkFactories.getTimerFactory());
+ sessionStream_ = new BasicSessionStream(StreamType.ClientStreamType, connection_, payloadParserFactories_, payloadSerializers_, networkFactories.getTLSContextFactory(), networkFactories.getTimerFactory(), options.tlsOptions);
if (certificate_ != null && !certificate_.isNull()) {
sessionStream_.setTLSCertificate(certificate_);
}
@@ -352,8 +353,8 @@ public class CoreClient {
break;
/* Note: no case clause for "StreamError" */
}
- } else if (error instanceof SessionStream.Error) {
- SessionStream.Error actualError = (SessionStream.Error) error;
+ } else if (error instanceof SessionStream.SessionStreamError) {
+ SessionStream.SessionStreamError actualError = (SessionStream.SessionStreamError) error;
switch (actualError.type) {
case ParseError:
clientError = new ClientError(ClientError.Type.XMLError);
@@ -373,7 +374,7 @@ public class CoreClient {
}
} else if (error instanceof CertificateVerificationError) {
CertificateVerificationError verificationError = (CertificateVerificationError)error;
- switch (verificationError.type) {
+ switch (verificationError.getType()) {
case UnknownError:
clientError = new ClientError(ClientError.Type.UnknownCertificateError);
break;