How to configure things to connect to the Redis instance from Steeltoe app without using TLS after enabling TLS in Redis tile
search cancel

How to configure things to connect to the Redis instance from Steeltoe app without using TLS after enabling TLS in Redis tile

book

Article ID: 295153

calendar_today

Updated On:

Products

Redis for VMware Tanzu

Issue/Introduction

Steeltoe documentation says that ssl is false by default https://docs.steeltoe.io/api/v3/connectors/redis.html. However Steeltoe app attempts to connect to Redis via TLS and below exception is getting generated after enabling TLS in Redis tile: https://docs.pivotal.io/redis/2-4/preparing-tls.html#enable.
 
2021-12-01T19:03:17.263+05:30 [APP/PROC/WEB/0] [OUT] System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
2021-12-01T19:03:17.263+05:30 [APP/PROC/WEB/0] [OUT] ---> StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). There was an authentication failure; check that passwords (or client certificates) are configured correctly.
2021-12-01T19:03:17.263+05:30 [APP/PROC/WEB/0] [OUT] at StackExchange.Redis.ConnectionMultiplexer.ConnectImpl(ConfigurationOptions configuration, TextWriter log) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1195
2021-12-01T19:03:17.263+05:30 [APP/PROC/WEB/0] [OUT] at StackExchange.Redis.ConnectionMultiplexer.Connect(ConfigurationOptions configuration, TextWriter log) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1061
2021-12-01T19:03:17.263+05:30 [APP/PROC/WEB/0] [OUT] --- End of inner exception stack trace ---
This article is about how to configure things to connect to the Redis instance from Steeltoe app without using TLS while still maintaining redis TLS connections for other apps. 


Environment

Product Version: 2.4

Resolution

TLS is being prioritized when it finds the tls_port defined in a service key. The output configurations read tls_port=0 (CloudFoundryConfigurationProvider). Overriding the tls_port to 0 has the effect of disabling TLS on the steeltoe client. 

Below is an example about how to configure the Steeltoe cloud configuration to use the non-TLS port.
public void ConfigureServices(IServiceCollection services)
{
    Configuration["vcap:services:p.redis:0:credentials:tls_port"] = "0";
    services.ConfigureCloudFoundryOptions(Configuration);
    ...
}