Allow env specification of Redis connection SSL parameters #1751
+22
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Changes
I decided to deploy this project in my Kubernetes cluster and it looks like by default there is no way to accept self-signed certificates when using TLS to connect to a Redis instance.
I am currently running a Redis instance on my local network requiring TLS for connections (setting
port 0
andtls-port 6379
directives in/etc/redis/redis.conf
) and using a self-signed cert. When attempting to connect to the Redis instance,django-redis
is throwing the following error:django_redis.exceptions.ConnectionInterrupted: Redis ConnectionError: Error 1 connecting to 192.168.xx.x:6379. [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)
After doing a quick search, I came across this issue in
django-redis
that outlines the fix for this. Also, it does appear that configuration is outlined in thedjango-redis
repo README as well.While I was adding this I figured it would be good to also include the ability to specify other possible common SSL configuration parameters as outlined here in the
redis-py
project.Assuming these changes are acceptable and once they are approved/merged I will open an accompanying PR in https://github.com/wger-project/docker to document these changes as well.
Please check that the PR fulfills these requirements
[ ] Tests for the changes have been added (for bug fixes / features)N/A given this is an env configuration