zorn-v / xmpp

Library for XMPP protocol connections (Jabber) for PHP
Other
9 stars 2 forks source link

XML parsing error when connecting to ejabberd #2

Open fabiano-pereira opened 6 years ago

fabiano-pereira commented 6 years ago

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 '<?xml version="1.0" encoding="UTF-8"?>

' 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 '' from 'tcp://localhost:5222'
zorn-v commented 6 years ago

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

fabiano-pereira commented 6 years ago

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)