Skip to content
Alexey Yakovlev edited this page Nov 21, 2018 · 3 revisions

By Dmitry Belikov

License

The license is MIT.

Channels

How I can check whether my server is reachable?

Just make any invocation to the remote host. If the host is unreachable, Genuine Channels will fire an exception with GenuineChannels.Exception.Send.DestinationIsUnreachable error identifier, so you easily can recognize it programmatically. Usually it takes about 5 seconds for Genuine Channels to check the connection.

Firewall and what ports should be opened?

If you use GTCP channel, just open firewall for incoming connections to the server’s port. Usually it is enough. If you use GHTTP channel, then user should be able to download any web page from your site hosting .NET Remoting solution. You need to set up proxy settings on the client, if client uses proxy server.

What about HTTP authentication?

I highly do not recommend using HTTP channel authentication. Build up and use an appropriate Security Session instead. This is faster, efficiently and gives you much more possibilities.

Features

When I tried to send a message containing 1 megabyte buffer, it failed with a packet too large error...

You have met with the queue restriction. You need to increase MaxPacketSize and MaxTotalSize channel settings to the reasonable values. Take a look though the Queuing section in Programming Guide for more details.

Why sending 1/2/3 megabyte buffer takes so much time?

Genuine Channels compress the content being sent by default. So it tries to compress 1/2/3 megabytes during the sending and, of course, it takes a lot of CPU, memory and time resources. You can switch off the compression either via forcing compressionless Security Session, or specifying Compression="false" channel's parameter.

What about FIPS compatibility?

Asked by michelstlouis: When FIPS is enabled on Windows 10, the communication stops. Is FIPS supported?

FIPS (Federal Information Processing Standards) are a set of standards that describe document processing, encryption algorithms and other information technology standards for use within non-military government agencies and by government contractors and vendors who work with the agencies (from https://whatis.techtarget.com/definition/FIPS-Federal-Information-Processing-Standards)

Answered by netsrotr: We had the problem in the past (years ago, sorry). But as I remember it depends on the used security algorithms you use for GC communication encryption. We use GC.SecuritySessionServices with SSPI.SspiFeatureFlags.None / SSPI.SupportedSspiPackages.Negotiate to encrypt the important parts of communication and have no problems with FIPS compliance. Here same code snippets that might help you.

Helper functions somewhere in a static class that returns as a wrapper for calls to a remove server object:

public static IDisposable SecurityContextKeeper()
{
  if (!IsWebProcessEnvironment)
  {
    // server is IRemotable/MarshalByRefObject
    return GenuineChannelsHelper.SecurityContextKeeper(server); 
  }
  return new SimpleDisposable();
}

Used to call this way:

public static T SafeAndSecureRemoteFunctionCall<T>(Func<T> remoteFunc)
{
  if (remoteFunc == null)
    throw new ArgumentNullException("remoteFunc");

  try
  {
    using (SecurityContextKeeper())
    {
      return remoteFunc();
    }
  }
  catch (Exception ex)
  {
    // may throw, if it was a communication failure:
    ServiceCommunicationException.AnalyzeAndThrow(ex, FriendlyServiceNameAndUri, IsRemotingActive);
    throw; // if not yet thrown
  }
}

and GenuineChannelsHelper.cs:

public static IDisposable SecurityContextKeeper(IRemotableComponentBase service)
{
  if (RemotingServices.IsTransparentProxy(service))
  {
    return new SecurityContextKeeper(new SecuritySessionParameters(
      SESSecurityKeyProviderName,
      SecuritySessionAttributes.EnableCompression, // we do that always
      TimeSpan.MinValue));
  }
  return new SimpleDisposable();
}

I need a XYZ feature!

Great, we'll accept your PRs.

View PDF guides

Download CHM files

Clone this wiki locally