redis / redis-py

Redis Python client
MIT License
12.68k stars 2.53k forks source link

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

Open vedantroy opened 1 month ago

vedantroy commented 1 month ago

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)
jules-ch commented 1 month ago

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

dmaier-redislabs commented 1 month ago

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