I have successfully compiled libstrophe as a Windows DLL (using VS2008), but I have a problem with the TLS negotiation. In tls_start() (tls_schannel.c) the first call to InitializeSecurityContextA works, and all 45 bytes of the token get sent to the server. The server returns just 7 bytes (in one chunk). No further bytes are returned, and when InitializeSecurityContextA is next called, it returns SEC_E_INCOMPLETE_MESSAGE and libstrophe gives up. If it's any help, the seven bytes are (consistently):
0x15
0x03
0x01
0x00
0x02
0x02
0x28
The complete list of TLS-related debug messages is:
TLSS DEBUG QuerySecurityPackageInfo() success
TLSS DEBUG AcquireCredentialsHandle() success
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
TLSS DEBUG QuerySecurityPackageInfo() success
TLSS DEBUG AcquireCredentialsHandle() success
xmpp DEBUG Couldn't start TLS! error -
2146893032It appears the server sent 7 bytes and then closed the socket, but can anyone tell me why, please, and how to correct the problem? I can connect to the server using the same credentials using Pidgin, so they should work with libstrophe. I can't see anything wrong with the code in tls_start(), though I don't pretend to know what tokens are supposed to get passed back and forth.
I've tried a second XP PC with similar results, and I've tried disabling TLS, but then the server just tells me to use TLS and slams the door in my face :).