Closed RieUchdia closed 2 years ago
Below is the snippet of code I'm using:
var config = new ConfigurationOptions();
config.EndPoints.Add("127.0.0.1:6379");
config.CertificateValidation += ValidateServerCertificate;
config.Ssl = true;
config.TrustIssuer("path to\\ca.crt");
config.SslHost = "127.0.0.1";
config.AbortOnConnectFail = false;
config.CertificateSelection += delegate
{
var cert = new X509Certificate2("path to\\ca.crt", "");
return cert;
};
Debug.Log("CertificateSelection");
multiplexer = await ConnectionMultiplexer.ConnectAsync(config);
Debug.Log($"Redis connected{multiplexer.GetStatus()}");
public static bool ValidateServerCertificate(
object sender,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
if (sslPolicyErrors == SslPolicyErrors.None)
{
Debug.Log("ValidateServerCertificate OK");
return true;
}
Debug.LogError("Certificate error: {0}" + sslPolicyErrors);
return false;
}
Below is the redis-server config:
################################# tls/ssl #####################################
port 0
tls-port 6379
tls-cert-file /etc/ssl/certs/redis.crt
tls-key-file /etc/ssl/certs/redis.key
tls-ca-cert-file /etc/ssl/certs/ca.crt
tls-ca-cert-dir /etc/ssl/certs
tls-auth-clients no
loglevel notice
logfile ""
This issue has been resolved. Client certificate settings were not required.
a
Hello,
I want to connect to Redis over SSL, but I'm failing.
How to connect to Redis on docker container over SSL from Unity application for windows?
when I run the Redis command (KEYS), I get an error.
Below is the error I got: