redis-py icon indicating copy to clipboard operation
redis-py copied to clipboard

Cannot connect using the Redis URL, but can connect by specifying hostname.

Open vedantroy opened this issue 1 year ago • 2 comments

Version: 5.1.0.

Platform: python:3.10-slim Docker image.

Description: I can connect if I manually specify the hostname:

        self.redis = aioredis.Redis(
  	       host='my-upstash-subdomain.upstash.io',
  	       port=6379,
  	       password='****',
  	       ssl=True,
           decode_responses=False
        )

But I get a connection error if I do the following:

from redis import asyncio as aioredis
self.redis = aioredis.from_url("redis://****@my-upstash-subdomain.upstash.io:6379", decode_responses=False)

vedantroy avatar Oct 01 '24 02:10 vedantroy

You've set ssl to true, have you tried with rediss:// scheme ?

jules-ch avatar Oct 02 '24 22:10 jules-ch

Hi @vedantroy,

@jules-ch is right. You can find further details here:

https://redis.io/chat?page=1&q=Hi%2C+if+I+want+to+connect+via+TLS+to+Redis+by+using+an+URL.+How+does+the+URL+need+to+look%3F

Does this solve your problem? Can we close this issue?

Regards, David

dmaier-redislabs avatar Oct 04 '24 10:10 dmaier-redislabs

Closing this issue since there no activity for a few months and a resolution was suggested. Please feel free to reopen it if further assistance is needed.

petyaslavova avatar Feb 21 '25 15:02 petyaslavova