Team XSockets.NET

Require SSL

Require SSL is an attribute that can be used on controller/method level. This attribute will make sure that communication on the controller (or method) is encrypted.

This can be useful if you have clients (maybe sensors) that cant use SSL. For example you might have multiple endpoints in the server since you have sensors or other clients that cant use TLS/SSL. These clients are probably behind a firewall and the endpoint is therefor not public. You might also have public endpoints that use TLS/SSL. To make sure that some methods/controllers are only used with TLS/SSL you can decorate them with the RequireSSL attribute.

using XSockets.Core.XSocket;
using XSockets.Core.XSocket.Helpers;
using XSockets.Core.Common.Socket.Attributes;
using XSockets.Plugin.Framework;
using System.Threading.Tasks;
using XSockets.Core.Common.Utility.Logging;
using XSockets.Core.Common.Socket.Event.Interface;

public class Sample : XSocketController
{
    [RequireSsl]
    public async Task Secure(IMessage m)
    {
        await this.InvokeToAll(m);
    }

    //Allowed to call without TLS/SSL
    public async Task UnSecure(IMessage m)
    {
        await this.InvokeToAll(m);
    }
}

results matching ""

    No results matching ""