Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis sslprotocols=tls12 support #318

Open
code-junky opened this issue Jul 30, 2020 · 2 comments
Open

Redis sslprotocols=tls12 support #318

code-junky opened this issue Jul 30, 2020 · 2 comments

Comments

@code-junky
Copy link

Azure Redis has deprecated TLS 1.0 and 1.1 and will retire these protocols in the near future. According to Microsoft, StackExchange.Redis users need to add sslprotocols=tls12 to their connection string to support TLS 1.2.

Unfortunately, this doesn't seem to work for CacheManager. When adding this option to our connection string, it throws back an error with the same connection string but excludes this option. It seems like CacheManager reconstructs the string internally and doesn't support this particular option.

Here's the code we use to create the CacheManager instance:

CacheFactory.Build<string>(settings =>
	settings.WithUpdateMode(CacheUpdateMode.Up)
		.WithRedisConfiguration("redis", connectionString, redisDatabaseId)
		.WithRedisCacheHandle("redis", false)
);

Here's the redis connection string:
myrediscacheurl.net:6380,password=myredisaccesskey,ssl=True,abortConnect=False,sslprotocols=tls12

Here's the error we're getting:
Connection to 'myrediscacheurl.net:6380,password=****,ssl=True,abortConnect=False' failed.

Notice that the error excludes the sslprotocols=tls12 portion of the connection string? Has anyone else encountered this? Is there a known fix?

@MichaCo
Copy link
Owner

MichaCo commented Jul 30, 2020

Yeah that looks like something I'd have to add to the configuration part of the Redis client.

The only work around right now would be to initializing the multiplexer yourself and pass the instance to CacheManager (there is an option to do that)

@jkatsiotis
Copy link

jkatsiotis commented Nov 2, 2020

Redis .NET clients use the earliest TLS version by default on .NET Framework 4.5.2 or earlier, and use the latest TLS version on .NET Framework 4.6 or later. If you're using an older version of .NET Framework, you can enable TLS 1.2 manually

[source]

So I guess if you are using .NET 4.6 and above it should work without changing the connection string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants