I have Django application with celery, which works fine.
app = Celery('backend', broker='amqp://guest:guest@localhost:5672//',)
Then I tried to cipher connection with SSL:
app = Celery('backend', broker='amqp://guest:guest@localhost:5672//',)
app.config_from_object('django.conf:settings', namespace='CELERY')
And with settings.py:
import ssl
CELERY_BROKER_USE_SSL = {
'keyfile': '/var/ssl/server-key.pem',
'certfile': '/var/ssl/server-crt.pem',
'ca_certs': '/var/ssl/ca-crt.pem',
'cert_reqs': ssl.CERT_REQUIRED
}
defining certificates as described in https://stackoverflow.com/a/34712536/6153117 but when running celery -A backend worker
I got the error
[2018-03-04 16:27:16,771: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:645).
Trying again in 2.00 seconds...
[2018-03-04 16:27:18,794: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:645).
Trying again in 4.00 seconds...