summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2014-07-22Make Stroke return peer certificate chain, rather then just EE certificateNick Hudson
Since the initial Stroke TLS implementation was done, some changes were made in Swiften, starting with "Show Certificate dialog from certificate error window." 159e773b156f531575d0d7e241e2d20c85ee6d7cA which mean that certificate verification uses the peer's certificate chain, and not just the peer's EE certificate. This change updates Stroke so that its API now more closely matches what Swiften does. Note that any current Stroke clients that implement the "CertificateTrustChecker" interface will break, as this patch makes an incompatible change to that interface, requiring implementing classes to handle a certificate chain rather than a single certificate. Isode copyright notices are updated; Remko copyright notices are updated to reflect the current copyright notices in any equivalent Swiften source files. Test-information: Used MLC (after having patched it for CertificateTrustChecker changes) and verified that it sees the entire certificate chain coming back. Ran self-tests for Stroke and saw no junit failures Change-Id: I3d863f929bfed3324446cadf3bb4d6b9ff916660
2014-04-22Move hardcoded XMPP SRV information from Connector into CoreClientNick Hudson
The Connector class had "_xmpp-client._tcp." hard-coded in it, which meant that it was not suitable for non XMPP clients. This change means that Connector could now be used by clients who are interested in arbitrary SRV records; the CoreClient class is updated accordingly. Test-information: Built and tested using MLC. Also tested with a client that is interested in IMAP SRV records Change-Id: Ia23c148fd8afdd7b3271c47b1c96d086d57a44bd
2014-03-07PubSub parsers and serializers, plus manager and test code.Richard Maudsley
Change-Id: Ie8ca77ba8dbcd83926d46307ad0e73d804ff7422
2014-02-03Check sender on incoming IQ responsesNick Hudson
This patch corresponds with the Swiften commit 5f1cb0d768265347bc80862c33f5967f07759b10 whose comment reads Release-Notes: Fixed a bug whereby the sender of an iq wasn't being checked before matching it to a request. Note that since the Swiften change, other modifications have been made to the affected files, and these modifications are not reflected in this patch. Test-information: Code builds. Ran with MLC to make sure things all seem to work OK. Change-Id: Ife96925d4d728bc0fe749d6b5b849fbe4e866315
2013-09-18Update NetworkFactories to own TLSContextFactory as per SwiftenNick Hudson
This change moves responsibility for creating the TLSContextFactory from CoreClient into NetworkFactories, which is in line with the Swiften implementation. This means that a caller may now provide his own concrete TLSContextFactory using code of the form: NetworkFactories myNetworkFactories; . . myNetworkFactories = new JavaNetworkFactories(eventLoop()) { @Override public TLSContextFactory getTLSContextFactory() { return new MyTLSContextFactory(); } }; Test-information: I implemented separate TLSContextFactory and TLSContext classes that used OpenSSL via JNI) to provide SSL functionality. I was able to switch to using these with the mechanism that this patch provides. I also verified that existing code which doesn't try to provide its own NetworkFactories subclass still works as before (i.e. this patch doesn't break existing applications). Change-Id: Ibf07ddbbb4a4d39e4bb30a28be9aa0c43afe005f Signed-off-by: Nick Hudson <nick.hudson@isode.com>
2012-10-18And more cleanupsKevin Smith
Change-Id: I862e11dc293ce84e0311f1ad470293e07735aeaf
2012-10-18Reduce PMD's whining a little furtherKevin Smith
Change-Id: Ib02394df2c7bb818c2409b1d6f2fc3ad0d938224
2012-10-18Trying to quieten down PMD's complaining a little bitKevin Smith
Change-Id: Id2710c674abc19cdf2b37f97fe53288b86c7f367
2012-10-18Enable compression now that zlib worksKevin Smith
Change-Id: Iab58df1cf6a3b8b9461b71fd3f27476214e07286
2012-10-02Avoid NPEsKevin Smith
2012-10-02Protect against null manual hostnamesKevin Smith
2012-10-02Adding Support for SoftwareVersionResponderKevin Smith
2012-09-21Update some interfaces for consistency with Swiften.Kevin Smith
Makes ClientOptions do more.
2012-09-21Remove superfluous event loopKevin Smith
2012-09-21UseTLS needs to be publicKevin Smith
2012-08-22Increase visibility of Client Error TypeGurmeen Bindra
In order to make it available to clients. Test-information: tested using an XMPP Admin tool to display connection type error
2012-04-27MUC Administration related classesGurmeen Bindra
This change ports the MUC Administration related classes from Swiften to stroke. Also includes the MUC initialisation code in the CoreClient. Test-information: tested the ported unit tests
2012-03-29Make CoreClient.getSessionCertificate more robustNick Hudson
The javadoc for the method was not in line with its behaviour, so you could get a NullPointerException if you asked for a session certificate when the session wasn't TLS. This patch makes the code do what the javadoc says (and what clients most likely want) Test-information: Returns null rather than crashing when I ask for a certificate on a non-TLS stream.
2012-03-19Add "isTLSEncrypted" and "getPeerCertificate" to CoreClientNick Hudson
Corresponding with change in Swiften (assuming that is approved; it's not yet been integrated at the time of writing) Test-information: Works as expected in my test applications
2012-03-19Update CoreClient to be a bit more in line with SwiftenNick Hudson
This change - renames the "onError" signal to be "onDisconnected" (as per change 59be74ec6 in Swiften) - adds "setCertificateTrustChecker()" method and uses the supplied checker when configuring TLS Test-information: My applications still work. When I configure my server with a certificate that doesn't correspond to the requirements in RFC 6120, my CertificateTrustChecker gets called, and the session is either dropped or maintained depending on what my checker returns.
2012-03-08Implement "CertificateWithKey" and add support for setting client certificatesNick Hudson
This change provides the functionality to allow clients to specify a PKCS#12 file containing client certificate/key for use when starting TLS sessions. The PKCS12Certificate class now subclasses "CertificateWithKey" (matching the Swiften implementation). Swiften also has "CAPICertificate", which is another subclass of CertificateWithKey. This has not been provided in this patch. From a client's point of view, all that's necessary to specify a certificate to be used for TLS is to do something like CertificateWithKey myCert = new PKCS12Certificate( "/home/fred/myp12file.p12", "secret".toCharArray()); coreClient.setCertificate(myCert); before calling "CoreClient.connect". Matching the Swiften functionality, constructing a new PKCS12Certificate does not actually perform validation of the P12 file/passphrase; that takes place when the p12 file is used. There is limited scope for returning to the caller errors describing possible problems, but JSSEContext uses the "emitError" method which does maintain error information, which is available in a debugger, or from the JSSEContext.toString() method. Test-information: Set up an M-Link server with TLS verified that - when I specify a client certificate with suitable SAN, the client sends it and the server reports authentication using the certificate - when I specify a client certificate without a suitable SAN, the client sends it but the server rejects it
2012-02-23Allow non-standard ports on internal interface methodKevin Smith
2012-01-19Some more "toString()" to help with development/debuggingNick Hudson
Also fixed up some incorrect Remko copyrights
2012-01-18Add toString to some more classesNick Hudson
Also made "Stanza" be an abstract class and had its ".toString()" include the name of the subclass which is involved, so that the subclasses don't have to do that themselves. Also added null check to existing HostAddress.toString() method Also fixed Remko copyright in Connector class Test-information: Stuff is displayed as expected in debugger.
2012-01-12Add Javadoc for CoreClient, EventLoop, JIDMili Verma
Test-information: Looks okay.
2011-11-03public oversightKevin Smith
2011-10-31Fix utf-8 encoding on Remko's name throughout. Now compiles with Java 7Kevin Smith
2011-07-01Initial importKevin Smith