Search code examples
iissslremotingsslstreamtcpchannel

.NET Remoting over SSL with TCPChannel


I need to secure my .NET Remoting by SSL. I'm using TCPChannel and I can't switch to HTTPChannel and use IIS to add the SSL.

Thus, what I figured out, I need to create my own Sink that will encrypt the streams going to/from Client/Server. For that, I found good article at MSDN: http://msdn.microsoft.com/en-us/magazine/cc300447.aspx. However, that article is developing the crypt, handshake, etc.

I do not want to "reinvent the wheel". I'm afraid of making mistakes when developing this logic on my own. I would rather like to use some SSL implementation (e.g. SslStream or OpenSSL) that will do that stuff for me.

Can I use SslStream or OpenSSL in .NET Remoting with the TCPChannel? Would you suggest a simple usage?

Thank you for your help.


Solution

  • Consider switching over to WCF.

    Alternatively, Remoting should be able to do the equivalent of using WCF with ClientCredentialType set to Windows, if you specify secure='true' in your remoting configuration on both client and server side. TcpChannel will start using SSL under the hood to encrypt the communication, using user credentials for key material. On client side, this also has the implied effect of setting tokenImpersonationLevel='identify' which means that the server will not impersonate the user account under which the client is executing, but it will know who connected to it (assuming the client and the server run in the same AD domain). For performance reasons, set useAuthenticatedConnectionSharing to true on the client side.