0 votes
by (120 points)

I have a Windows .Netframework 4.5 app that I am trying to connect to a Python TLS server using a simple TlsClientSocket(). After successfully connecting, I call the socket.Negotiate() function and receive a TlsException with an ProtocolCode of 10 and a message of 'Unexpected Message'

What does this normally imply? I can successfully connect my python server to a python client and negotiate to TLS 1.3 but every time I try it using the Rebex libraries I can only get 1.2 or this error.

Any assistance would be greatly appreciated,
reedmi1

1 Answer

0 votes
by (5.3k points)
edited by

Hi reedmi1,
welcome to the Rebex forum.
Could you please send a communication log (DEBUG level) to support@rebex.net?
The log can be created like this.

client.LogWriter = new Rebex.FileLogWriter(@"c:\temp\log.txt", Rebex.LogLevel.Debug);

https://www.rebex.net/kb/logging/

by (120 points)
Thanks.  I sent everything you asked for and more to that email.
by (5.3k points)
Thanks, I can confirm that we have received your message.
by (120 points)
Thanks.  I got your second email and replied with everything you asked for.  :)
by (5.3k points)
Thanks. I already sent the answer to your address, and I hope that the mystery is solved. ;)
by (5.3k points)
For other visitors of the Rebex forum.  Reedmi1 confirmed that the problem is solved.
The problem was caused by the doubled TLS negotiation. One TLS handshake was initiated by the instance of the TlsSocket and then independent instance of the TlsStream had started the second handshake. Both TlsStream and TlsSocket instances were initialized using the same (reference equals) instance of the .NET socket in their constructors.
...