We’re setting up our first Redis server (version 7.0.1). The credentials given to me are working using the Redli utility, and also in c# connecting to via the StackExchange.Redis library. But not via the SS library.
Error is “RedisResponseException: WRONGPASS invalid username-password pair or user is disabled.” If I use the exact string produced by the variable SvrWithCreds below in redli, I can connect.
Sample code to reproduce:
string usr = "xxxxxx";
string pwd = "yyyyyyy";
string svr = "redis01.zzzzz.com";
int port = 6379;
// ----------------- StackExchange.Redis ---------------------------
var opt = new StackExchange.Redis.ConfigurationOptions()
{
User = usr,
Password = pwd,
EndPoints =
{ { svr, port } }
};
var redis = StackExchange.Redis.ConnectionMultiplexer.Connect(opt);
StackExchange.Redis.IDatabase db = redis.GetDatabase();
string value = db.StringGet("x");
Console.WriteLine(value);
// ----------------- ServiceStack.Redis ---------------------------
string SvrWithCreds = $"redis://{usr}:{pwd}@{svr}:{port}";
Console.WriteLine(SvrWithCreds);
var pool = new ServiceStack.Redis.RedisManagerPool(SvrWithCreds);
var client = pool.GetClient();