Trying to connect to Redis (Memurai) on separate server within local network using TLS. I can connect to a Primary via non-TLS using ServiceStack code just fine.
I can also connect using CLI to Sentinel over TLS from a server in same network.
Below code is giving timeout:
ConfigurationOptions options = new ConfigurationOptions
{
AbortOnConnectFail = false,
ConnectTimeout = 30000, // 30 seconds
SyncTimeout = 30000, // 30 seconds
EndPoints = { { host, 26379 } }, // 6379 Primary
User = "default", //null,
Password = null, // pw is not required
Ssl = true,
SslProtocols = System.Security.Authentication.SslProtocols.Tls12,
ServiceName = "Primary", // sentinel
AllowAdmin = true,
SslHost = host
};
options.CertificateValidation += ValidateServerCertificate;
bool ValidateServerCertificate(
object sender,
X509Certificate? certificate,
X509Chain? chain,
SslPolicyErrors sslPolicyErrors)
{
// omitting code as I’m gettting sslPolicy errors = None
}
ConnectionMultiplexer muxer = ConnectionMultiplexer.Connect(options); // gets timeout
Error:
StackExchange.Redis.RedisConnectionException: The message timed out in the backlog attempting to send because no connection became available (30000ms) – Last Connection Exception: UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 1s ago, last-write: 1s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 0s ago, v: 2.6.122.38350, command=ROLE, timeout: 30000, inst: 0, qu: 1, qs: 0, aw: False, bw: SpinningDown, last-in: 0, cur-in: 0, sync-ops: 1, async-ops: 0, serverEndpoint: 127.0.0.1:6379, conn-sec: n/a, aoc: 0, mc: 1/1/0, mgr: 10 of 10 available, clientName: XXXXX(SE.Redis-v2.6.122.38350), IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=0,Free=32767,Min=4,Max=32767), POOL: (Threads=4,QueuedItems=0,CompletedItems=271,Timers=32), v: 2.6.122.38350
Christopher Sawyer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.