Microsoft.Extensions.Caching.Redis 2.2.0 and not SSL = false

Christopher Neff 21 Reputation points
2020-08-11T00:53:07.273+00:00

Hi. I currently have a Azure Redis instance and it seems using the Microsoft.Extensions.Caching.Redis 2.2.0 seems to only allow me to connect using non-SSL. Note: I do have TLS 1.2 enforced on my instance. Any thoughts?

Azure Cache for Redis
Azure Cache for Redis
An Azure service that provides access to a secure, dedicated Redis cache, managed by Microsoft.
260 questions
0 comments No comments
{count} votes

Accepted answer
  1. KalyanChanumolu-MSFT 8,336 Reputation points
    2020-08-12T12:38:19.467+00:00

    @Christopher Neff Thank you for providing the code sample.

    I faced the same issue while reproducing this.
    There seems to be an issue internal to StackExchange.Redis while connecting to an SSL port when using an IP Address.

    Any reason why you would want to resolve the DNS to IP while connecting?
    Please try using the DNS instead and it should work.

            var cfg = new ConfigurationOptions  
            {  
                //EndPoints = { new IPEndPoint(ipAddresses[0], port) },  
    	        EndPoints =  
                            {  
                                { "dss-ccn-account-for-dev.redis.cache.windows.net", 6380 }  
                            },  
    
                Ssl = false,  
                Password = "<removed key>", // AUTH  
                ClientName= nameof(Demo_03_03),  
                AllowAdmin = false,  
                AbortOnConnectFail = true,  
                ConnectRetry = 3,  
                ConnectTimeout = 10000,  
                SyncTimeout = 10000  
            };  
    

    Please do let me know if it doesn't work for you.

    ----------

    If an answer is helpful, please "Accept answer" or "Up-Vote" for the same which might be beneficial to other community members reading this thread.


1 additional answer

Sort by: Most helpful
  1. KalyanChanumolu-MSFT 8,336 Reputation points
    2020-08-11T08:02:41.123+00:00

    @Christopher Neff Thank you for your interest in Azure Cache for Redis.
    I tried using Microsoft.Extensions.Caching.Redis 2.2.0 today with an Azure Cache for Redis configured for TLS 1.2 and it works fine.

    My connection string

     "RedisCache": {  
        "ConnectionString": "XXXXXX.redis.cache.windows.net:6380,password=****************=,ssl=True,abortConnect=False"  
      }  
    

    My Redis cache configuration

    16889-image.png

    I have attached the code snippet as a file
    16894-rediscachecodesnippet.txt

    If you are behind a corporate firewall or VPN, if could be possible that the SSL port 6380 is blocked.
    Please work with your network administrator to configure the firewall accordingly.

    Do let us know if you are face any issues.

    --

    If an answer is helpful, please "Accept answer" or "Up-Vote" for the same which might be beneficial to other community members reading this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.