-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document usage of Redis + SSL #57
Comments
You can use CELERY_SINGLETON prefix to provide config options for the backend. In your case it would be:
|
@aemdy Is it possible to make use of the existing broker_use_ssl or is the preferred way to do this via Approach 1 import ssl
from typing import Final
from app import config
from lib.celery import Celery, celery_queue_name
from lib.celery.singleton import Singleton
def configure_celery(app: Celery) -> Celery:
app.conf.singleton_backend_kwargs = {
"ssl_cert_reqs": ssl.CERT_REQUIRED,
"ssl_certfile": "/ca-certs/redis.crt",
"ssl_keyfile": "/ca-certs/redis.key",
"ssl_ca_certs": "/ca-certs/ca.crt",
}
return app
celery = configure_celery(
app=Celery(
__name__,
broker="redis://localhost:6379",
task_create_missing_queues=True,
task_acks_late=True,
task_time_limit=60,
)
) Aproach 2 celery = Celery(
__name__,
broker="redis://localhost:6379",
task_create_missing_queues=True,
task_acks_late=True,
task_time_limit=60,
broker_use_ssl={
"ssl_cert_reqs": ssl.CERT_REQUIRED,
"ssl_certfile": "/ca-certs/redis.crt",
"ssl_keyfile": "/ca-certs/redis.key",
"ssl_ca_certs": "/ca-certs/ca.crt",
}
) |
Q: As an alternative, does using the "rediss:" URL (with the extra s) work ? |
Ran into some issues getting setup with SSL using
celery-singleton
As I couldn't find a working way to pass args necessary to the redis instance used I ended up creating a
RedisSSLBackend
class and configuring celery with the following:The text was updated successfully, but these errors were encountered: