At first, please make sure that the TLS certificate is indeed accessible. I've seen these kind of errors when the certificate was silently not loaded.
Bernd On Tue, Jun 4, 2013 at 4:15 AM, Dave <[email protected]> wrote: > Hi, > > I'm trying to embed Vysper into an app which will listen for S2S > connections, replying to certain incoming stanzas and initiating business > messages to other servers.Currently, I'm failing to establish a > server-to-server connection.The remote end appears to complete the dialback > handshake, but Vysper times out after receiving the db:result stanza. > > Can anyone help me with clues to what I've got wrong,or should it even > work as I'm expecting? > > [detail, code and logs follow] > > I've knocked up the following snippet which exhibits the behaviour I'm > seeing: > > public static void main(String... args) { > try { > XMPPServer server = new XMPPServer("local.co.uk"); > > StorageProviderRegistry providerRegistry = new > MemoryStorageProviderRegistry(**); > server.**setStorageProviderRegistry(**providerRegistry); > > S2SEndpoint s2sEndpoint = new S2SEndpoint(); > s2sEndpoint.setPort(31423); > server.addEndpoint(**s2sEndpoint); > > server.setTLSCertificateInfo(**new File("keystore.ks"), "secret"); > server.start(); > server.**getServerRuntimeContext().**getServerFeatures().** > setRelayingToFederationServers**(true); > > Thread.sleep(10 * 1000); > > Entity remoteServer = > EntityImpl.parseUnchecked("rem**ote.org.uk<http://remote.org.uk> > "); > XMPPServerConnectorRegistry serverConnectorRegistry = server.** > getServerRuntimeContext().**getServerConnectorRegistry(); > XMPPServerConnector connector = serverConnectorRegistry.** > connect(remoteServer); > > System.out.println("Connected"**); > Thread.sleep(2 * 1000); > > String messageId = VysperUtils.generateUniqueId()**; > StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(**null, > remoteServer, IQStanzaType.SET, messageId); > stanzaBuilder.addText("some random text " + messageId); > connector.write(stanzaBuilder.**build()); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > On the remote end lives an existing xmpp server, which indicates that the > remote receives the connection and sends the dialback key. > > Jun 04 02:45:36 s2sin11005b0 info Incoming s2s connection > Jun 04 02:45:36 s2sout120afe0 info Beginning new connection attempt > to glark.co.uk (x.x.x.x:31423) > Jun 04 02:45:36 s2sout120afe0 info sent dialback key on outgoing s2s > stream > Jun 04 02:46:06 s2sin11005b0 info s2s disconnected: glark.co.uk-> > daveball.org.uk (closed) > > > In the vysper logs, I can see that the dialback connection is opened, TLS > negotiation takes place, and dialback ensues.Vysper report receiving the > dial back response (actually two, one before TLS and one after), but > doesn't seem to do anything with it, and times out 30 seconds later: > > Jun 04, 2013 2:45:36 AM FINE: Processing a MESSAGE_RECEIVED for session > 3 > Jun 04, 2013 2:45:36 AM FINE: Decoder writing stanza: <db:result > xmlns:db="jabber:server:**dialback" to="local.co.uk" from="remote.org.uk"> > **ffdd0afd536c826324d2715fd7cc2a**8448a9c45378382c75b5289aa3d041** > f81c</db:result> > Jun 04, 2013 2:45:36 AM FINE: < <db:result > xmlns:db="jabber:server:**dialback" > to="local.co.uk" from="remote.org.uk">**ffdd0afd536c826324d2715fd7cc2a** > 8448a9c45378382c75b5289aa3d041**f81c</db:result> > Jun 04, 2013 2:45:36 AM FINE: Adding event MESSAGE_RECEIVED to session 3 > Queue : [MESSAGE_RECEIVED, ] > Jun 04, 2013 2:45:36 AM FINE: Firing a MESSAGE_RECEIVED event for > session 3 > Jun 04, 2013 2:46:06 AM WARNING: XMPP handshake with remote.org.uk at > () timed out > Jun 04, 2013 2:46:06 AM WARNING: Failed connecting to XMPP server > remote.org.uk at remote.org.uk./x.x.x.x:31424 > > > Full vysper log at: http://pastebin.com/XmLNSriP > > > Many thanks, > Dave >
