meduketto / iksemel

Automatically exported from code.google.com/p/iksemel
GNU Lesser General Public License v2.1
31 stars 24 forks source link

Failure to authenticate against Prosody server #55

Open N7DR opened 4 years ago

N7DR commented 4 years ago

When I try to authenticate against a prosody server, the call to iks_start_tls() returns IKS_OK, but when I actually try to send data I see the following in the server log:

May 04 15:26:57 c2s564b6a802a40 debug TLS negotiation started for c2s_unauthed... May 04 15:26:57 socket debug server.lua: attempting to start tls on tcp{client}: 0x564b6a7fefe8 May 04 15:26:57 socket debug server.lua: ssl handshake error: wrong version number May 04 15:26:57 c2s564b6a802a40 info Client disconnected: ssl handshake error: wrong version number May 04 15:26:57 c2s564b6a802a40 debug Destroying session for (unknown) ((unknown)@jabber.ipfonix.com): ssl handshake error: wrong version number
May 04 15:26:57 socket debug server.lua: closed client handler and removed socket from list

How can I force iksemel to give me more details about this failed negotiation? I can't find any documentation about forcing iksemel to use a particular TLS version, or even interrogating iksemel to discover which version is being used.


Is there a sample anywhere of code that uses iksemel to communicate a CHAT session over TLS? I basically used the code from iksroster.c, and I think the code is OK, but if there's an example anywhere of successfully chatting over TLS, that would be a good check to make sure I haven't done something stupid. Everything looks fine though, until this:

iks* x = iks_make_msg(IKS_TYPE_CHAT, dest.c_str(), msg.c_str()); cout << "After iks_make_msg" << endl; int status = iks_send(_iks_parser_p, x); cout << "After iks_send" << endl;

The first of the two messages is printed, the second never appears, so something bad is happening inside iks_send(), and it's never returning. Presumably that's where the TLS negotiation is failing, and the client disconnects, but never returns to tell me of the problem. How do I investigate all this?