Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SignalR cannot connect to Azure Redis on SSL

I am currently hosting my redis cache server on Azure, and have signalR relying on it as the backbone using the following...

GlobalHost.DependencyResolver.UseRedis("Server",port,"password","eventKey");

This works find on port 6379 (non-SSL) but my chat app breaks when I try to connect to the SSL port (6380) of my Azure Redis server, and the hub is never started. What could be the cause of this issue? Or am I doing something wrong?

This is the error that appears on /signalr/connect in my browser net::ERR_CONNECTION_RESET

like image 282
Todd Avatar asked Apr 10 '15 20:04

Todd


2 Answers

You can try this: GlobalHost.DependencyResolver.UseRedis(new RedisScaleoutConfiguration(connectionString, "YourServer"));

And connection string something like:

connectionString="yourNameHere.cache.windows.net,ssl=true,password=YourPasswordKey"

Make sure you are using SignalR built with StackExchange.Redis (latest is gratest ;)

like image 149
Michael Parshin Avatar answered Oct 15 '22 08:10

Michael Parshin


I upgraded the signalr core library to version 2.2.3.0 and used the below syntax, works like a charm.

var redisServer = ConfigurationManager.AppSettings[Constants.RedisServer].ToString();

var redisServerPassword = ConfigurationManager.AppSettings[Constants.RedisServerPassword].ToString();

var connectionString = $"{redisServer},password={redisServerPassword},ssl=True,abortConnect=False";
GlobalHost.DependencyResolver.UseRedis(new RedisScaleoutConfiguration(connectionString, "APIIdentifierString"));
like image 1
Sudherson Vetrichelvan Avatar answered Oct 15 '22 08:10

Sudherson Vetrichelvan