From 10acd4f9515dcbcee84883cd6df80208928a9e66 Mon Sep 17 00:00:00 2001 From: jacekv Date: Mon, 18 Nov 2024 20:47:10 +0100 Subject: [PATCH 1/2] PAN-2270: Point to certs --- pantos/servicenode/celery.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pantos/servicenode/celery.py b/pantos/servicenode/celery.py index 5f2c103..be7086c 100644 --- a/pantos/servicenode/celery.py +++ b/pantos/servicenode/celery.py @@ -7,6 +7,7 @@ import amqp # type: ignore import celery # type: ignore +import certifi # type: ignore from pantos.common.logging import LogFile from pantos.common.logging import LogFormat from pantos.common.logging import initialize_logger @@ -47,7 +48,7 @@ def is_main_module() -> bool: 'pantos.common.blockchains.tasks', 'pantos.servicenode.business.transfers', 'pantos.servicenode.business.plugins' - ]) + ], broker_use_ssl={'ca_certs': certifi.where()}) """Celery application instance.""" # Additional Celery configuration From 2e92036b377e404ce2448ad706be94825c74068c Mon Sep 17 00:00:00 2001 From: jacekv Date: Tue, 19 Nov 2024 10:37:52 +0100 Subject: [PATCH 2/2] PAN-2270: Set proper path based on broker url --- pantos/servicenode/celery.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pantos/servicenode/celery.py b/pantos/servicenode/celery.py index be7086c..2928061 100644 --- a/pantos/servicenode/celery.py +++ b/pantos/servicenode/celery.py @@ -42,13 +42,16 @@ def is_main_module() -> bool: _logger.info('Initializing the Celery application...') initialize_application(False) +ca_certs = {} if config['celery']['broker'].startswith('amqp') else { + 'ca_certs': certifi.where() +} celery_app = celery.Celery( 'pantos.servicenode', broker=config['celery']['broker'], backend=config['celery']['backend'], include=[ 'pantos.common.blockchains.tasks', 'pantos.servicenode.business.transfers', 'pantos.servicenode.business.plugins' - ], broker_use_ssl={'ca_certs': certifi.where()}) + ], broker_use_ssl=ca_certs) """Celery application instance.""" # Additional Celery configuration