.netrediscertificatestackexchange.redisamazon-elasticache

How can I disable certificate validation with StackExchange.Redis?


We are utilizing StackExchange.Redis for our .Net applications and are upgrading from Redis 3.2.10 hosted on-prem to AWS Elasticache 5.0.5 where we will are enabling transit_encryption and at_rest_encryption.

For any particular system, we deploy two Elasticache instances, one for NonProd environments, and another for Prod. As such, we want to create CNAMEs to those Elasticache instances to include the environment names. Doing so with ssl=true in the connection string results in the following error:

The remote certificate is invalid according to the validation procedure.

Which is understandable; but is it possible to disable certificate validation within the client? Ideally the connection string itself?


Solution

  • You cannot do this through connection string, but you can use ConfigurationOptions.CertificateValidation, please see answer to "SSL connectivity to Redis with StackExchange.Redis"