Steps to test libstrobe xmpp library by connecting to "ejabberd" local web-server.
#####################################################################
# How to install and run eJabber (xmpp) Local Server:
#####################################################################
Refer weblink:
1.
sudo apt-get install ejabberd
2.
sudo echo "<ip address of LAN/WLAN port> im.example.com" >> /etc/hosts
3.
ejabberdctl register admin localhost password
ejabberdctl register admin im.example.com password
4.
in /etc/ejabberd/ejabberd.yml, make the following changes
acl:
admin:
user:
- "admin": "localhost"
- "admin": "im.example.com"
hosts:
- "localhost"
- "im.example.com"
5.
sudo service ejabberd restart
6.
by default tls will be enabled in the ejabber webserver. so, login into the below
via https.
https://im.example.com:5280/admin
##############################################################################
How to use libstrope library to connect to ejabberd xmpp local server
jabber xmpp client using libstrope library :
neelkanth_surekha#./basic admin@im.example.com password
<./basic jid password>
<jid = username@domain>
<in /etc/hosts, the domain should be mapped to LAN / WLAN ip address of the PC>
##############################################################################
neelkanth_surekha#./basic admin@im.example.com password
##############################################################Connecting the client (using libstrope library) to a the above local xmpp
server:##############################################################
xmpp DEBUG SRV lookup failed, connecting via domain.
xmpp DEBUG sock_connect() to im.example.com:5222 returned 3
xmpp DEBUG Attempting to connect to im.example.com
xmpp DEBUG connection successful
conn DEBUG SENT: <?xml version="1.0"?><stream:stream to="im.example.com" xml:lang="en" version="1.0" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
xmpp DEBUG RECV: <stream:stream id="10566243970409419856" from="im.example.com" version="1.0" lang="en">
xmpp DEBUG RECV: <features xmlns="http://etherx.jabber.org/streams"><c hash="sha-1" xmlns="http://jabber.org/protocol/caps" ver="GtsjYPujnBb89z2vC8P/arjzmdE=" node="http://www.process-one.net/en/ejabberd/"/><register xmlns="http://jabber.org/features/iq-register"/><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></features>
conn DEBUG SENT: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
xmpp DEBUG RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
xmpp DEBUG handle proceedtls called for proceed
xmpp DEBUG proceeding with TLS
tls DEBUG Certificate verification FAILED
tls DEBUG error=1 errno=0
tls DEBUG error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
conn DEBUG Couldn't start TLS! error -3 tls_error 1
conn DEBUG SENT: </stream:stream>
xmpp DEBUG Send error occurred, disconnecting.
xmpp DEBUG Closing socket.
DEBUG: disconnected
event DEBUG Stopping event loop.
event DEBUG Event loop completed
##############################################################Connecting the client (using libstrope library) to a public XMPP server:##############################################################
neelkanth_surekha# ./basic 0nl1ne.cc admin
xmpp DEBUG sock_connect() to 0nl1ne.cc:5222 returned 3
xmpp DEBUG Attempting to connect to 0nl1ne.cc
xmpp DEBUG connection successful <--------------------------
conn DEBUG SENT: <?xml version="1.0"?><stream:stream to="0nl1ne.cc" xml:lang="en" version="1.0" xmlns="jabber:client" ---------> cllent to server message
xmlns:stream="http://etherx.jabber.org/streams">
xmpp DEBUG RECV: <stream:stream id="1647763183857810588" version="1.0" lang="en" from="0nl1ne.cc"> ---------> server to client
xmpp DEBUG RECV: <features xmlns="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required/></starttls></features>
conn DEBUG SENT: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
xmpp DEBUG RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
xmpp DEBUG handle proceedtls called for proceed
xmpp DEBUG proceeding with TLS
tls DEBUG Certificate verification passed <-------------- public server verification passed.
conn DEBUG SENT: <?xml version="1.0"?><stream:stream to="0nl1ne.cc" xml:lang="en" version="1.0" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
xmpp DEBUG RECV: <stream:stream id="8385509599575574023" version="1.0" lang="en" from="0nl1ne.cc">
xmpp DEBUG RECV: <features xmlns="http://etherx.jabber.org/streams"><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms><register xmlns="http://jabber.org/features/iq-register"/><auth xmlns="http://jabber.org/features/iq-auth"/></features>
auth ERROR No node in JID, and SASL ANONYMOUS unsupported. <-------------------- Authentication failed.
conn DEBUG SENT: </stream:stream>
xmpp DEBUG RECV: </stream:stream>
xmpp DEBUG Closing socket. ---> connection closed here.
DEBUG: disconnected
event DEBUG Stopping event loop.
event DEBUG Event loop completed.