StackExchange / StackExchange/StackExchange.Redis
Connection to Azure Redis is not working from some machines
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.2k
- Forks
- 1.6k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
We have a solution using Azure Cache for Redis. This is working fine in our Dev environment (I'm attaching logs for working connection: RedisGoodConnection.txt), but we can't make it work in our Acceptance environment (Attached "RedisBadConnection.txt).
The only difference that I can think about is firewall rules, but firewall is open. In fact in the logs I can see that the connection is done, but TLS handshake is not happening.
Some things that I've tried, with no result:
- Bypassing Certificate validation (config.CertificateValidation += (a,b,c,d)=> true;)
- Enabling TLS 1.2 for .net framework (as suggested here: https://johnlouros.com/blog/enabling-strong-cryptography-for-all-dot-net-applications). No result either.
Any idea on how to troubleshoot this will be welcome 8·)
This is a code demoing the error (redis url and password are dummy values here):
var redisConString = "oneazurerediscache.redis.cache.windows.net:6380,password=myprivatekey,ssl=True,abortConnect=False,sslprotocols=tls12,connectTimeout=30000";
var redis = ConnectionMultiplexer.Connect(redisConString,Console.Out);
Packages used are the last version available:
<package id="StackExchange.Redis" version="2.1.58" targetFramework="net472" />
<package id="StackExchange.Redis.Extensions.Core" version="6.3.5" targetFramework="net472" />
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing RedisBadConnection.txt with RedisGoodConnection.txt, then reproduce the issue with the provided ConnectionMultiplexer.Connect example using StackExchange.Redis 2.1.58 on net472. Investigate the differing Acceptance-machine TLS handshake behavior and document a verified cause or fix when the connection succeeds there.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, redis
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100