Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/363.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何设置芹菜与Azure Redis实例进行ssl对话_Python_Python 2.7_Azure_Redis_Celery - Fatal编程技术网

Python 如何设置芹菜与Azure Redis实例进行ssl对话

Python 如何设置芹菜与Azure Redis实例进行ssl对话,python,python-2.7,azure,redis,celery,Python,Python 2.7,Azure,Redis,Celery,使用“”的最佳答案,我可以使用以下Python代码,通过非ssl端口6379将芹菜配置为使用Azure Redis缓存: from celery import Celery # This one works url = 'redis://:<access key>@<my server>.redis.cache.windows.net:6379/0' # I want to use a url that specifies ssl like one of the foll

使用“”的最佳答案,我可以使用以下Python代码,通过非ssl端口6379将芹菜配置为使用Azure Redis缓存:

from celery import Celery
# This one works
url = 'redis://:<access key>@<my server>.redis.cache.windows.net:6379/0'
# I want to use a url that specifies ssl like one of the following:
# url = 'redis://:<my key>=@<my server>.redis.cache.windows.net:6380/0'
# url = 'redis://:<my key>@<my server>.redis.cache.windows.net:6380/0?ssl=True'
app = Celery('tasks', broker=url)

@app.task
def add(x, y):
    return x + y

对于代理,您应该能够设置配置选项

对于后端,该选项在4.1.0版本中提供

通过URL启用SSL的功能尚不可用:


另外,请注意。但是,您可以按照

中的说明操作它。现在已经可以使用
redis://
而不是
redis://

url = 'rediss://:<access key>@<my server>.redis.cache.windows.net:6380/0'
url='redis://:@.redis.cache.windows.net:6380/0'
url = 'rediss://:<access key>@<my server>.redis.cache.windows.net:6380/0'