lhost / sendxmpp

perl-script to send xmpp (jabber), similar to what mail(1) does for mail.
64 stars 22 forks source link

sendxmpp doesn't work with TLS on FreeBSD #37

Open Hund opened 4 years ago

Hund commented 4 years ago

I installed FreeBSD 12.1 on my Raspberry Pi 2 yesterday and I have some issues with sendxmpp (version 1.24) not working for me. I have the package security/ca_root_nss and I have tried specifying every single path I could think of.

$ echo "Test" | sendxmpp <adress> -t --tls-ca-path="/usr/local/etc/ssl"
Use of uninitialized value $sid in hash element at /usr/local/bin/sendxmpp line 381.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1829.
Use of uninitialized value $sid in concatenation (.) or string at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 2735.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 2737.
Use of uninitialized value $sid in concatenation (.) or string at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1668.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1669.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1669.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1671.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1673.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1673.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1675.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1678.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 2615.
Use of uninitialized value $sid in concatenation (.) or string at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 2735.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 2737.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1440.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1443.
Use of uninitialized value within %status in numeric eq (==) at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1506.
Use of uninitialized value in subtraction (-) at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1507.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1669.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1673.
Use of uninitialized value in hash element at /usr/local/lib/perl5/site_perl/Net/XMPP/Connection.pm line 433.
Use of uninitialized value in hash element at /usr/local/lib/perl5/site_perl/Net/XMPP/Connection.pm line 440.
Use of uninitialized value in hash element at /usr/local/lib/perl5/site_perl/Net/XMPP/Connection.pm line 433.
Use of uninitialized value in string eq at /usr/local/bin/sendxmpp line 515.
Error 'AuthSend': [?]
Use of uninitialized value $sid in concatenation (.) or string at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1668.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1669.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1671.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1673.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1266.
Use of uninitialized value in string eq at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1266.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1266.
Use of uninitialized value in string eq at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1266.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1267.
Use of uninitialized value in delete at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1267.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1268.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1270.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1270.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1270.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1270.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1270.
Use of uninitialized value $sid in hash element at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1270.
Use of uninitialized value $sid in delete at /usr/local/lib/perl5/site_perl/XML/Stream.pm line 1272. 

I have also noted that it looks like FreeBSD uses one single file for the certs while some (all?) Linux based operating systems uses one file per cert, at least in Gentoo and Debian.

Is there anything I can do to make this work? sendxmpp is a very important must have tool for me.

Thank you for your time!

JulienPalard commented 1 year ago

I have a very similar issue, with TLS on Debian:

$ echo coucou | sendxmpp --debug <address>
sendxmpp: config: 'jserver' => 'chapril.org'
sendxmpp: config: 'tls' => '1'
sendxmpp: config: 'password' => '<redacted for privacy>'
sendxmpp: config: 'username' => 'mdk.fr'
XML::Stream: new: hostname = (seraph)
XML::Stream: SetCallBacks: tag(node) func(CODE(0x55e0b8a32ce0))
XMPP::Conn: xmppCallbackInit: start
XMPP::Conn: SetCallBacks: tag(message) func(CODE(0x55e0b89de138))
XMPP::Conn: SetCallBacks: tag(presence) func(CODE(0x55e0b8a32ec0))
XMPP::Conn: SetCallBacks: tag(iq) func(CODE(0x55e0b8a31428))
XMPP::Conn: SetPresenceCallBacks: type(unsubscribe) func(CODE(0x55e0b8a31758))
XMPP::Conn: SetPresenceCallBacks: type(unsubscribed) func(CODE(0x55e0b8a331f0))
XMPP::Conn: SetPresenceCallBacks: type(subscribe) func(CODE(0x55e0b89de180))
XMPP::Conn: SetPresenceCallBacks: type(subscribed) func(CODE(0x55e0b8a31158))
XMPP::Conn: SetDirectXPathCallBacks: xpath(/[@xmlns="urn:ietf:params:xml:ns:xmpp-tls"]) func(CODE(0x55e0b8a3f688))
XMPP::Conn: SetDirectXPathCallBacks: xpath(/[@xmlns="urn:ietf:params:xml:ns:xmpp-sasl"]) func(CODE(0x55e0b8a332e0))
XMPP::Conn: xmppCallbackInit: stop
sendxmpp: ssl_verify: 1
sendxmpp: tls_ca_path: 
XMPP::Conn: Connect: host(chapril.org:5222) namespace(jabber:client)
XMPP::Conn: Connect: timeout(10)
XML::Stream: Connect: type(tcpip)
XML::Stream: Connect: Got a connection
XML::Stream: Send: (<?xml version='1.0'?><stream:stream version='1.0' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='chapril.org' from='seraph' xml:lang='en' >)
XML::Stream: Read: buff(<?xml version='1.0'?><stream:stream id='5666948181799171979' version='1.0' xml:lang='en' xmlns:stream='http://etherx.jabber.org/streams' to='seraph' from='chapril.org' xmlns='jabber:client'><stream:features><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'><required/></starttls></stream:features>)
XMPP::Conn: Connect: connection made
XML::Stream: SetCallBacks: tag(node) func(CODE(0x55e0b8a33238))
XML::Stream: Send: (<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>)
XML::Stream: Read: buff(<proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>)
XML::Stream: TLSClientProceed: Convert normal socket to SSL
XML::Stream: TLSClientProceed: sock(IO::Socket::INET=GLOB(0x55e0b8a3ff10))
XML::Stream: LoadSSL: Load the IO::Socket::SSL module
XML::Stream: LoadSSL: Success
XML::Stream: TLSClientProceed: ssl_sock(IO::Socket::INET=GLOB(0x55e0b8a3ff10))
XML::Stream: TLSClientProceed: SSL: We are secure
O�$? ��r�h�F�xr�6�):��f(���
���U�^��b��p�����q/ ]�É���)D��z���c�Kң1�L˫���3qOӬq=;?u���q�\�Oؘ|�O�B����p����N�Zw�
                                                                                 F![E5��;��4yZ��k��Dy��D�����E@=H��`l�1��F��~�x�`���{E��ԴLI@@VF�)
XML::Stream: Send: (<?xml version='1.0'?><stream:stream version='1.0' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='chapril.org' from='seraph' xml:lang='en' >)
XML::Stream: Read: buff()
XML::Stream: Read: ERROR
sendxmpp: Connect: 1
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1828.
XMPP::Conn: AuthIQAuth: old school auth
XMPP::Conn: SendAndReceiveWithID: object(Net::XMPP::IQ=HASH(0x55e0b8a335c8))
XMPP::Conn: SendWithID: id(netjabber-0)
XMPP::Conn: SendWithID: in(<iq type='get'><query xmlns='jabber:iq:auth'><username>mdk.fr</username></query></iq>)
XMPP::Conn: RegisterID: tag(iq) id(netjabber-0)
XMPP::Conn: SendWithID: out(<iq id='netjabber-0' type='get'><query xmlns='jabber:iq:auth'><username>mdk.fr</username></query></iq>)
XMPP::Conn: SendXML: sent(<iq id='netjabber-0' type='get'><query xmlns='jabber:iq:auth'><username>mdk.fr</username></query></iq>)
Use of uninitialized value $sid in concatenation (.) or string at /usr/share/perl5/XML/Stream.pm line 2739.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 2741.
XML::Stream: Send: (<iq id='netjabber-0' type='get'><query xmlns='jabber:iq:auth'><username>mdk.fr</username></query></iq>)
Use of uninitialized value $sid in concatenation (.) or string at /usr/share/perl5/XML/Stream.pm line 1667.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1668.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/XML/Stream.pm line 1668.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1670.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1672.
Use of uninitialized value in numeric eq (==) at /usr/share/perl5/XML/Stream.pm line 1672.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1674.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1677.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 2619.
Use of uninitialized value $sid in concatenation (.) or string at /usr/share/perl5/XML/Stream.pm line 2739.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 2741.
XMPP::Conn: SendAndReceiveWithID: sent with id(netjabber-0)
XMPP::Conn: WaitForID: id(netjabber-0)
XMPP::Conn: ReceivedID: id(netjabber-0)
XMPP::Conn: ReceivedID: nope...
XMPP::Conn: WaitForID: haven't gotten it yet... let's wait for more packets
XMPP::Conn: Process: timeout(1)
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/XML/Stream.pm line 1439.
Use of uninitialized value in numeric eq (==) at /usr/share/perl5/XML/Stream.pm line 1442.
Use of uninitialized value $status{"newconnection"} in numeric eq (==) at /usr/share/perl5/XML/Stream.pm line 1505.
Use of uninitialized value in subtraction (-) at /usr/share/perl5/XML/Stream.pm line 1506.
XML::Stream: Send: ( )
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/XML/Stream.pm line 1668.
Use of uninitialized value in numeric eq (==) at /usr/share/perl5/XML/Stream.pm line 1672.
Use of uninitialized value in hash element at /usr/share/perl5/Net/XMPP/Connection.pm line 433.
Use of uninitialized value in hash element at /usr/share/perl5/Net/XMPP/Connection.pm line 440.
XMPP::Conn: ReceivedID: id(netjabber-0)
XMPP::Conn: ReceivedID: nope...
XMPP::Conn: WaitForID: haven't gotten it yet... let's wait for more packets
XMPP::Conn: Process: timeout(1)
XML::Stream: Send: ( )
XML::Stream: Send: ( )
XML::Stream: Send: ( )
Use of uninitialized value in hash element at /usr/share/perl5/Net/XMPP/Connection.pm line 433.
Use of uninitialized value in string eq at /usr/bin/sendxmpp line 515.
Error 'AuthSend': [?]
XML::Stream: Send: (</stream:stream>)
Use of uninitialized value $sid in concatenation (.) or string at /usr/share/perl5/XML/Stream.pm line 1667.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1668.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1670.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1672.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1265.
Use of uninitialized value in string eq at /usr/share/perl5/XML/Stream.pm line 1265.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1265.
Use of uninitialized value in string eq at /usr/share/perl5/XML/Stream.pm line 1265.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1266.
Use of uninitialized value in delete at /usr/share/perl5/XML/Stream.pm line 1266.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1267.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1269.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1269.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1269.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1269.
Use of uninitialized value $sid in hash element at /usr/share/perl5/XML/Stream.pm line 1269.
Use of uninitialized value $sid in delete at /usr/share/perl5/XML/Stream.pm line 1271.
XML::Stream: SetCallBacks: tag(node) func(CODE(0x55e0b8a32ef0))
XMPP::Conn: Disconnect: bye bye
sendxmpp: Disconnect

(I "solved" my issue by using the drop-in replacement go-sendxmpp that uses the same configuration file and worked.)