fix: redis 开启 ssl websocket连接失败

pull/12163/head
feng 2023-11-17 22:31:01 +08:00 committed by 老广
parent ed92f10208
commit 452b383278
1 changed files with 1 additions and 5 deletions

View File

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
#
import os
from urllib.parse import urlencode
from .base import (
REDIS_SSL_CA, REDIS_SSL_CERT, REDIS_SSL_KEY, REDIS_SSL_REQUIRED, REDIS_USE_SSL,
@ -88,7 +87,6 @@ REDIS_LAYERS_HOST = {
REDIS_LAYERS_SSL_PARAMS = {}
if REDIS_USE_SSL:
REDIS_LAYERS_SSL_PARAMS.update({
'ssl': REDIS_USE_SSL,
'ssl_cert_reqs': REDIS_SSL_REQUIRED,
"ssl_keyfile": REDIS_SSL_KEY,
"ssl_certfile": REDIS_SSL_CERT,
@ -115,9 +113,7 @@ else:
protocol=REDIS_PROTOCOL, password=CONFIG.REDIS_PASSWORD,
host=CONFIG.REDIS_HOST, port=CONFIG.REDIS_PORT, db=CONFIG.REDIS_DB_WS
)
REDIS_LAYERS_SSL_PARAMS.pop('ssl', None)
REDIS_LAYERS_HOST['address'] = '{}?{}'.format(REDIS_LAYERS_ADDRESS,
urlencode(REDIS_LAYERS_SSL_PARAMS))
REDIS_LAYERS_HOST['address'] = REDIS_LAYERS_ADDRESS
CHANNEL_LAYERS = {
'default': {