-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Hi Doron,
I hope you are well, especially in these CoViD times.
I am a software engineer from Germany, and currently I apply NetMQ in a peer-to-peer messaging project, with NetMQ.Security.
You did not post about NetMQ.Security for some time, but I am still hopeful that you might provide some helpful advices.
I am using NetMQ 4.0.x in a hybrid .NET Framework and .NET Core environment (.NET Standard 2.0).
Thus, I am using NetMQ.Security not from nutget, but from github, which has been migrated to .NET Standard 1.6.
I am intending to use Router/Dealer ("Harmony Pattern") [1].
For NetMQ.Security, I am just doing the first steps, all experiments are still decoupled from my actual code.
Your post from 2013 [2] was helpful.
I got the Dealer/Dealer example up and running, in a NUnit class.
I am using BouncyCastle to successfully generate certificates at test run-time and could share the exact code with you, if necessary.
Then, I simply tried to change the server-side socket in your example to type RouterSocket; your comment suggest, that this should be possbible.
However, I get an NetMQ.Security.NetMQSecurityException ("Wrong length for protocol version frame").
Details:
The client initiates the connection and is waiting in line:
NetMQMessage incomingMessage= socket.ReceiveMultipartMessage();
The server is calling secureChanel.ProcessMessage the first time via line:
while (!secureChannel.ProcessMessage(incomingMessage, outgoingMessages))
This line throws an exception:
NetMQ.Security.NetMQSecurityException
HResult=0x80131500
Message=Wrong length for protocol version frame
Source=NetMQ.Security
StackTrace:
at NetMQ.Security.V0_1.SecureChannel.ProcessMessage(NetMQMessage incomingMessage, IList`1 outgoingMesssages) in C:...\NetMQ.Security\V0_1\SecureChannel.cs:line 103
I suspect, that the additional identity as part of the extended structure of NetMQMessage in case of Router/Dealer is the reason.
However, I am not quite sure how to proceed. Could you give me an advice?
Kind regards
Christoph
[1] https://netmq.readthedocs.io/en/latest/router-dealer/
[2] https://somdoron.com/2013/05/securing-netmq/