1

I am getting the following error within an external web app running on windows iis server connecting to Redis:

Couldn't connect to Redis server(s) 'redis-....test.cluster....:6379', will reconnect in 00:00:00.0400000

    StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s); The remote certificate is invalid according to the validation procedure.
    
       at StackExchange.Redis.ConnectionMultiplexer.ConnectImpl(Func`1 multiplexerFactory, Action`1 log)
    
       at StackExchange.Redis.ConnectionMultiplexer.Connect(ConfigurationOptions configuration, Action`1 log)
    
       at Hangfire.Pro.Redis.RedisStorage.CreateMultiplexer(EventWaitHandle reconnectEvent)
    
       at Hangfire.Pro.Redis.RedisStorage.ConnectLoop()

I added the enterprise root and intermediate certificate to the trusted certificates by mmc.

Test:

  1. Used Tool "Another Redis Desktop Manager" with same connection string --> works fine
  2. I created a TestRedis.exe which also use the StackExchange.REDIS in the same version and connected to REDIS with same connection string --> works fine

Any ideas or hints, what I can do fix the problem?

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • Please show your non working code which tries to connect to Redis. – jbl Oct 20 '21 at 16:22
  • Looks like there's a problem with certificate chain. Are you using a self-signed certificate on your Redis machines? Please see https://stackoverflow.com/questions/777607/the-remote-certificate-is-invalid-according-to-the-validation-procedure-using for answers (but I don't recommend using a proposed hack by returning `true` regardless of error). Custom certificate validation callback can be specified with the `RedisStorageOptions.CertificateValidation` property. – odinserj Oct 21 '21 at 10:07

0 Answers0