5

Im working on getting node-xmpp working with a jabber server we have in house here. I was able to get it working with talk.google.com just fine, and i can connect to our internal server with adium or ichat just fine.

  • Node v0.6.14
  • CentOS 6.2 / 2.6.32
  • node-xmpp 0.3.2
  • OpenSSL 1.0.0

connect code

var j = new xmpp.Client({
  jid : 'user@domain',
  password : 'pass',
  host : 'chat.domain'
});

After tracing through the code, it seems it gets stuck right after it tries to upgrade the connection to a secure connection. This occurs in starttls.js in the starttls function.

The pair.on('secure') event is never called, and even after i print out pair after a settimeout, its still not appearing to be authorized. At this point i dont see any data in or out.

After a long time sitting there (several minites) it prints out an error that looks like this

throw arguments[1]; // Unhandled 'error' event
        ^
Error: 139644497663968:error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error:s23_clnt.c:674:

    at CleartextStream._pusher (tls.js:508:24)
    at CleartextStream._push (tls.js:334:25)
    at SecurePair.cycle (tls.js:734:20)
    at EncryptedStream.write (tls.js:130:13)
    at Socket.ondata (stream.js:38:26)
    at Socket.emit (events.js:67:17)
    at TCP.onread (net.js:367:14)

The server is using a self signed cert if that matters.

Any ideas?

Thanks!

Space Devin
  • 1,127
  • 1
  • 13
  • 17
  • 1
    What server software are you using? (I'm going to stick my neck out and guess... Openfire?) – MattJ Mar 31 '12 at 22:58
  • Did you ever get this working? We're having the same issue with openfire and the latest version of node + node_xmpp. – dustyburwell Jan 23 '13 at 21:59

2 Answers2

0

This looks like you're sending a TLS handshake when the server isn't expecting it, so the server isn't sending its handshake back.

One possibility is that you're talking old-style TLS (handshake-first) to a server that implements start-TLS. In your real code, are you setting the legacySSL parameter? Are you sure you're talking to an XMPP server on the target box?

A wireshark trace would give us the data to be able to tell for sure.

Joe Hildebrand
  • 10,354
  • 2
  • 38
  • 48
0

I was experiencing the same issue: connection hangs while trying to perform a TLS handshake with one particular Openfire XMPP server installation (though others worked fine).

After nearly losing my mind, I ended up modifying starttls.js that ships with node-xmpp to use tls.connect() and forcing SSLv3 and to my surprise it worked.

Gist here: https://gist.github.com/jamescoletti/6591173

Hope this is useful to someone.