Skip to content

[change] Add support for rediss:// URLs #463

@nemesifier

Description

@nemesifier

Support for rediss:// URLs with authentication in Redis configuration.

Description

It's currently not possible to easily use a Redis server that requires a secure connection over TLS (rediss://) and password authentication.

Here’s the relevant code logic we observed:

if not REDIS_PASS:
    CHANNEL_REDIS_HOST = f'redis://{REDIS_HOST}:{REDIS_PORT}/1'
else:
    CHANNEL_REDIS_HOST = f'redis://:{REDIS_PASS}@{REDIS_HOST}:{REDIS_PORT}/1'

if not REDIS_PASS:
    CELERY_BROKER_URL = f'redis://{REDIS_HOST}:{REDIS_PORT}/2'
else:
    CELERY_BROKER_URL = f'redis://:{REDIS_PASS}@{REDIS_HOST}:{REDIS_PORT}/2'

CACHES = {
    'default': {
        'BACKEND': 'django_redis.cache.RedisCache',
        'LOCATION': f'redis://{REDIS_HOST}:{REDIS_PORT}/0',
    }
}

Suggested improvement

Allow full override of Redis URLs via environment variables (e.g., CHANNEL_REDIS_URL, CELERY_BROKER_URL, REDIS_CACHE_URL) so users can specify secure schemes like rediss:// and custom credentials.

Alternatively, extend the logic to support:

  • Custom Redis scheme (redis:// vs rediss://)
  • Custom Redis user
  • Optional authentication

This would improve compatibility with Redis services that enforce TLS and user-based authentication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions