Skip to content

Commit c55096b

Browse files
authored
Merge pull request #237 from OpenGeoscience/redis-ssl
2 parents 2ba72f7 + 7f14b41 commit c55096b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

geoinsight/settings.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import os
44
from pathlib import Path
5+
import ssl
56

67
from composed_configuration import (
78
ComposedConfiguration,
@@ -47,7 +48,11 @@ class GeoInsightMixin(ConfigMixin):
4748
'BACKEND': 'channels_redis.core.RedisChannelLayer',
4849
'CONFIG': {
4950
# Use /1 for channels backend, as /0 is used by celery
50-
'hosts': [f'{os.environ["REDIS_URL"]}/1'],
51+
'hosts': [
52+
{
53+
'address': f'{os.environ["REDIS_URL"]}/1',
54+
}
55+
],
5156
},
5257
}
5358
}
@@ -118,3 +123,10 @@ class HerokuProductionConfiguration(GeoInsightMixin, HerokuProductionBaseConfigu
118123
)
119124
),
120125
)
126+
127+
@staticmethod
128+
def mutate_configuration(configuration: ComposedConfiguration) -> None:
129+
# Heroku Redis uses self-signed certs
130+
configuration.CHANNEL_LAYERS['default']['CONFIG']['hosts'][0][
131+
'ssl_cert_reqs'
132+
] = ssl.CERT_NONE

0 commit comments

Comments
 (0)