C# 带Redis的信号器扩展-不支持SSL

C# 带Redis的信号器扩展-不支持SSL,c#,asp.net,azure,signalr,C#,Asp.net,Azure,Signalr,我已将nuget软件包Microsoft.AspNet.signal.Redis添加到我的项目中,以允许我使用Redis缓存背板扩展我的signar应用程序,如下所示: 我已经在Azure上安装了一个redis缓存服务器,使用到端口6379的非安全连接,一切都正常工作 我现在想启用SSL以增加安全性,但似乎不支持使用nuget插件的SSL连接: 如果我尝试使用安全端口6380,nuget包似乎不支持SSL连接 例如: GlobalHost.DependencyResolver.UseRedis

我已将nuget软件包Microsoft.AspNet.signal.Redis添加到我的项目中,以允许我使用Redis缓存背板扩展我的signar应用程序,如下所示:

我已经在Azure上安装了一个redis缓存服务器,使用到端口6379的非安全连接,一切都正常工作

我现在想启用SSL以增加安全性,但似乎不支持使用nuget插件的SSL连接:

如果我尝试使用安全端口6380,nuget包似乎不支持SSL连接

例如:

GlobalHost.DependencyResolver.UseRedis("redis-server.cloudapp.net", 6380,
"Password/Key", "ChatApp")
这不是启用SSL的开关

以下是连接的完整代码:

public class Startup
{
    public void Configuration(IAppBuilder app)
    {

        // Configuration for scale out using Redis:
        var redisEnabled = Convert.ToBoolean(WebConfigurationManager.AppSettings["RedisScaleOut_Enable"]);
        if (redisEnabled)
        {
            var redisHost = WebConfigurationManager.AppSettings["RedisScaleOut_Host"];
            var redisPort = Convert.ToInt16(WebConfigurationManager.AppSettings["RedisScaleOut_Port"]);
            var redisPassword = WebConfigurationManager.AppSettings["RedisScaleOut_Password"];
            var redisAppName = WebConfigurationManager.AppSettings["RedisScaleOut_AppName"];

            GlobalHost.DependencyResolver.UseRedis(redisHost, redisPort, redisPassword, redisAppName);
        }

        // Branch the pipeline here for requests that start with "/signalr"
        app.Map("/signalr", map =>
        {
            // Setup the CORS middleware to run before SignalR.
            // By default this will allow all origins. You can 
            // configure the set of origins and/or http verbs by
            // providing a cors options with a different policy.
            map.UseCors(CorsOptions.AllowAll);

            var hubConfiguration = new HubConfiguration
            {
                // You can enable JSONP by uncommenting line below.
                // JSONP requests are insecure but some older browsers (and some
                // versions of IE) require JSONP to work cross domain
                EnableJSONP = true
            };

            // Run the SignalR pipeline. We're not using MapSignalR
            // since this branch already runs under the "/signalr"
            // path.
            map.RunSignalR(hubConfiguration);
        });

    }
}

SignalR Redis背板目前正在使用书架,我可以看到他们正在使用裸插座连接Redis。我不知道Redis,但我假设通信不是基于HTTP的,而是基于TCP的,因此您不能直接使用SSL。

最新版本的SignalR(目前为2.2.1)允许SSL,如下所示:

var connectionString = "myredis.redis.cache.windows.net:6380,password=myPassword,ssl=True,abortConnect=False";

GlobalHost.DependencyResolver.UseRedis(new RedisScaleoutConfiguration(connectionString, "YourServer"));

感谢Michael Parshin的回答:

数据加密支持Redis不支持加密。为了实现可信方可以通过internet或其他不可信网络访问Redis实例的设置,应实施额外的保护层,如SSL代理。StackExchange.Redis缓存客户端和Microsoft.RedisSessionStateProvider都支持SSL。他们必须实现自己的代理或使用https进行通信。SignalR 2.2.0将使用StackExchange.Redis而不是Booksleeve。为了澄清StackExchange.Redis(截至目前1.0.481)对SSL的支持。