zorn-v / xmpp

Library for XMPP protocol connections (Jabber) for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XML parsing error when connecting to ejabberd

fabiano-pereira opened this issue · comments

ejabberd version: 16.01-2 (Ubuntu 16.04)

When connecting with Gajim client everything works fine.

File: vendor/zorn-v/xmpp/src/Exception/XMLParserException.php:68

Message: XML parsing error: "Not well-formed (invalid token)" at Line 1 at column 1

Error log:
2018-09-04T16:54:28-03:00 DEBUG (7): Received buffer '' from 'tcp://localhost:5222'
2018-09-04T16:54:28-03:00 DEBUG (7): Sending data '
<stream:stream to="localhost" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" version="1.0">' to 'tcp://localhost:5223'
2018-09-04T16:54:28-03:00 DEBUG (7): Listener "Fabiang\Xmpp\EventListener\Stream\Stream" is currently blocking
2018-09-04T16:54:28-03:00 DEBUG (7): Received buffer '<LOT_OF_TRASH_CHARACTERS>' from 'tcp://localhost:5222'

Seems you connect to ssl port. Try to use 5222
Or try to use tls://localhost:5223 connection url

The ejabberd server is using TLS, but when I use "tls://localhost:5223", the error changes to:

Message:
stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number

Stack trace:
#0 [internal function]: Fabiang\Xmpp\Util\ErrorHandler->Fabiang\Xmpp\Util{closure}(2, 'stream_socket_c...', '/home/...', 111, Array)
#1 vendor/zorn-v/xmpp/src/Stream/SocketClient.php(111): stream_socket_client('tls://localhost...', 0, '', 30, 4)
#2 [internal function]: Fabiang\Xmpp\Stream\SocketClient->Fabiang\Xmpp\Stream{closure}('tls://localhost...', 30, 4, Array)