qxmpp
qxmpp copied to clipboard
never sends <auth></auth>
I built qxmpp from master and it does not seem to send <auth></auth>
. It connects, does starttls and sends the challenge response without auth'ing. To verify I installed Kaidan (built against qxmpp-qt5-1.4.0 port) and it also does not authenticate, does not send a message.
The server is OpenFire 4.6.4.
To test, I can connect and send a message using Dino (vala with the XMPP vala library), sendxmpp (using perl with the Perl XMPP library), and I made a java program that uses the Smack client library and it connects and sends a message. Also I can connect to the server using openssl s_client and send the raw XML to log in and send a message, and that works.
It could be the server but all the other clients I've tried works and doing it manually by hand works. It's possible I've got the c++ code wrong. or it's a bug?
QXmppConfiguration config;
config.setDomain("waitman.net");
config.setUser("client");
config.setPassword("secret");
QXmppClient client;
connect(&client, SIGNAL(connected()), SLOT(onConnected()));
connect(&client, SIGNAL(error(QXmppClient::Error)), SLOT(onXmppError(QXmppClient::Error)));
connect(&client, SIGNAL(disconnected()), SLOT(onDisconnected()));
connect(&client, SIGNAL(messageReceived(QXmppMessage)), SLOT(onMessageReceived(QXmppMessage)));
connect(&client, SIGNAL(presenceReceived(QXmppPresence)), SLOT(onPresenceReceived(QXmppPresence)));
connect(&client, SIGNAL(iqReceived(QXmppIq)), SLOT(onIqReceived(QXmppIq)));
connect(&client, SIGNAL(sslErrors(QList<QSslError>)), SLOT(onSSLErrors(QList<QSslError>)));
connect(&client, SIGNAL(stateChanged(QXmppClient::State)), SLOT(onStateChanged(QXmppClient::State)));
client.connectToServer(config);
AFAIK The only signal firing is stateChanged. It's sending <stream:stream... twice (i think it should only send it the second time after authenticating???, then it has to bind the JID)
Mon Nov 22 13:15:46 2021 DEBUG Looking up server for domain waitman.net
Mon Nov 22 13:15:47 2021 INFO Connecting to waitman.net:5222
state changed QXmppClient::ConnectingState
state changed QXmppClient::ConnectingState
state changed QXmppClient::ConnectingState
Mon Nov 22 13:15:48 2021 INFO Socket connected to 45.79.97.18 5222
Mon Nov 22 13:15:48 2021 SENT <?xml version='1.0'?><stream:stream to='waitman.net' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>
Mon Nov 22 13:15:48 2021 RECEIVED <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="waitman.net" id="9r9tvyneft" xml:lang="en" version="1.0">
Mon Nov 22 13:15:48 2021 RECEIVED <stream:features><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"></starttls><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><ver xmlns="urn:xmpp:features:rosterver"/><register xmlns="http://jabber.org/features/iq-register"/><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="https://www.igniterealtime.org/projects/openfire/" ver="GPxX6olqy2a3smvHX4T/ksFMEyw="/></stream:features>
Mon Nov 22 13:15:48 2021 SENT <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
Mon Nov 22 13:15:48 2021 RECEIVED <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
Mon Nov 22 13:15:48 2021 DEBUG Starting encryption
Mon Nov 22 13:15:48 2021 DEBUG Socket encrypted
Mon Nov 22 13:15:48 2021 SENT <?xml version='1.0'?><stream:stream to='waitman.net' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>
The sending of <stream:stream>
seems to be fine. It needs to send it a second time to start the encrypted stream.
Does anything happen after the last line of the log?
I tested this with openfire 4.8.1 and I can't reproduce this, not with QXmpp 1.4.0, 1.6.0 or current master. Maybe something was wrong with your local ssl/tls setup or something was fixed in Openfire. I'll close this.