Connect to the Coordinator with TLS1.2

This topic explains how to secure communications between the coordinator and its agents/clients using SSL (TLS v1.2).

Setting up the Coordinator

The Coordinator's SSL options are configurable through the Connection panel on the Coordinator Settings window (accessible via the Coordinator Tray Application). To enable SSL, check the 'Use Secure Connections' checkbox.

Coordinator EnableTLS

After enabling secure connections, select a valid certificate to use from the drop down.

Note Note

The list of available certificates is populated from the local machine's Personal Windows Certificate Store. If a desired certificate is not displayed, make sure it has been installed for the local machine and not a specific user's account.

Coordinator Select Certificate
Setting up an Agent

All Agents attempting to connect to an SSL-enabled Coordinator must also be configured to use secure connections. Open the Connection panel of the Agent Settings window (accesible via the Agent Tray Application) and check the 'Use Secure Connections' checkbox.

Agent EnableTLS

If the Coordinator has been configured to use a self-signed certificate, check the 'Allow Self-Signed Certificates' checkbox.

Caution note Caution

Opting to use a self-signed certificate will bypass all certificate validation against trusted certificate authorities.

Connecting In Code

If the Coordinator and Agent(s) are using secured communications, any client code submitting jobs must also enable the option to use SSL. To do this, set the ClusterJobScheduler's UseSsl property to true. If using self-signed certificates, also set the AllowSelfSignedCertificates property to true.

C#
using System;
using System.Threading;
using AGI.Parallel.Client;
using AGI.Parallel.Infrastructure;
using AGI.Parallel.Infrastructure.Logging;

namespace CodeSamples
{
    class Program
    {
        static void Main(string[] args)
        {
            using (ClusterJobScheduler scheduler = new ClusterJobScheduler("localhost"))
            {
                scheduler.Connect();
                scheduler.UseSsl = true;
                scheduler.AllowSelfSignedCertificates = false;
                Job job = scheduler.CreateJob();
                Task task = new HelloTask();
                job.AddTask(task);
                job.Submit();
                job.WaitUntilDone();
                Console.WriteLine("Result = " + task.Result);
            }
        }
    }

    [Serializable]
    public class HelloTask : Task
    {
        public override void Execute()
        {
            Result = "Hello from Task";
        }
    }
}

STK Scalability 1.3 API for .NET