【发布时间】:2021-03-08 20:41:54
【问题描述】:
我正在尝试使用 StackExchange.Redis 从 asp.net MVC 应用程序连接到 Azure Cache For Redis 资源,并且它仅在我将端口设置为 6379 并且连接字符串中的 ssl=false 时才有效。
public class RedisCacheHelper
{
static RedisCacheHelper()
{
lazyConnection = new Lazy<ConnectionMultiplexer>(() =>
{
return ConnectionMultiplexer.Connect(****.redis.cache.windows.net:6380,password=******=,ssl=True,abortConnect=False);
});
}
private static Lazy<ConnectionMultiplexer> lazyConnection;
public static ConnectionMultiplexer Connection
{
get
{
return lazyConnection?.Value;
}
}
}
当我尝试使用 ssl=true 和我得到的 ssl 端口进行连接时:
“没有连接处于活动状态/可用于服务此操作:GET ******;阻塞操作被 WSACancelBlockingCall 调用中断,mc: 1/1/0, mgr: 10 of 10 available, clientName: DESKTOP-EMHQA7J,IOCP:(忙碌=0,空闲=1000,最小=12,最大=1000),工人: (忙=1,空闲=8190,最小=12,最大=8191),v:2.2.4.27433"}
这个文档说我应该有一个 .key 或 .pfx 文件,但我看不到我可以从 Azure 获取此类文件的位置。 https://docs.redislabs.com/latest/rs/references/client_references/client_csharp/
【问题讨论】:
标签: stackexchange.redis azure-redis-cache