I have this error A rediss:// URL must have parameter ssl_cert_reqs and this must be set to CERT_REQUIRED, CERT_OPTIONAL, or CERT_NONE
CELERY_BROKER_URL = os.environ.get('REDIS_URL', "redis://localhost:6379")
CELERY_RESULT_BACKEND = os.environ.get('REDIS_URL', "redis://localhost:6379")
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
from __future__ import absolute_import, unicode_literals
from celery import Celery
import os, ssl
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproj.settings')
app = Celery(
'myproj',
broker_use_ssl = {
'ssl_cert_reqs': ssl.CERT_NONE
})
app.config_from_object('django.conf:settings', namespace="CELERY")
app.autodiscover_tasks()
I changed the value of ssl_cert_reqs to different value 'none', 'cert_required', ..., but nothing, always the same error when I use rediss:// instead of redis://.
i never used option broker_use_ssl, can you try delete this option and try again
app = Celery('myproj')
or update
Celery('myproj',
broker_use_ssl = {
'ssl_cert_reqs': ssl.CERT_NONE
},
redis_backend_use_ssl = {
'ssl_cert_reqs': ssl.CERT_NONE
}
)
Adding a faster solution that worked for me - I updated my REDIS_URL value and appended ?ssl_cert_reqs=CERT_NONE. CERT_NONE can be replaced with CERT_OPTIONAL or CERT_NONE depending on the availability of the SSL cert
If REDIS_URL is an environment value in your app, then you probably don't need to change your code; just edit the value of the variable in your server or .env file as the case may be
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With