You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/01/14 14:24:16 UTC

[GitHub] ashb commented on a change in pull request #4521: [AIRFLOW-3704] Support SSL Protection When Redis is Used as Broker for CeleryExecutor

ashb commented on a change in pull request #4521: [AIRFLOW-3704] Support SSL Protection When Redis is Used as Broker for CeleryExecutor
URL: https://github.com/apache/airflow/pull/4521#discussion_r247509539
 
 

 ##########
 File path: airflow/config_templates/default_celery.py
 ##########
 @@ -60,10 +60,20 @@ def _broker_supports_visibility_timeout(url):
 
 try:
     if celery_ssl_active:
-        broker_use_ssl = {'keyfile': configuration.conf.get('celery', 'SSL_KEY'),
-                          'certfile': configuration.conf.get('celery', 'SSL_CERT'),
-                          'ca_certs': configuration.conf.get('celery', 'SSL_CACERT'),
-                          'cert_reqs': ssl.CERT_REQUIRED}
+        if 'amqp://' in broker_url:
+            broker_use_ssl = {'keyfile': configuration.conf.get('celery', 'SSL_KEY'),
+                              'certfile': configuration.conf.get('celery', 'SSL_CERT'),
+                              'ca_certs': configuration.conf.get('celery', 'SSL_CACERT'),
+                              'cert_reqs': ssl.CERT_REQUIRED}
+        elif 'redis://' in broker_url:
+            broker_use_ssl = {'ssl_keyfile': configuration.conf.get('celery', 'SSL_KEY'),
+                              'ssl_certfile': configuration.conf.get('celery', 'SSL_CERT'),
+                              'ssl_ca_certs': configuration.conf.get('celery', 'SSL_CACERT'),
+                              'ssl_cert_reqs': ssl.CERT_REQUIRED}
 
 Review comment:
   Celery is annoying :(

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services