Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why Django Redis does not raise exception while connecting to Redis Server with SSL param equal string "False" #717

Open
phandc opened this issue Jan 22, 2024 · 0 comments
Labels

Comments

@phandc
Copy link

phandc commented Jan 22, 2024

Hi everyone,

I had encountered a problem recently.
When my server was trying to connect to the Redis Server, I made a mistake passing the SSL param to the string "False" rather than a boolean False param.
It prevented my server from receiving any requests.
When I tried to access http://localhost:8080 from a web browser or even try curl http://localhost:8080, it did not receive any responses. The server did not raise any exceptions.
When I changed the SSL param from string to boolean, my server could receive the incoming requests.
I thought that the wrong string param I passed kept my server and Redis Server in an infinite loop without a timeout.
It blocked the main Django app thread. Therefore, the server could not receive any requests.

Here is my wrong config

REDIS = {
    'tasks': {
        'HOST': 'localhost',
        'PORT': 6379,
        'USERNAME': '',
        'PASSWORD': '',
        'DATABASE': 0,
        'SSL': 'False', # False (bool) not 'False' string.
        # Set this to True to skip TLS certificate verification
        # This can expose the connection to attacks, be careful
        # 'INSECURE_SKIP_TLS_VERIFY': False,
        # Set a path to a certificate authority, typically used with a self signed certificate.
        # 'CA_CERT_PATH': '/etc/ssl/certs/ca.crt',
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant