Skip to content

Changing the default value for ssl_check_hostname to True, to ensure security validations are not skipped by default #3626

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

Merged

Conversation

petyaslavova
Copy link
Collaborator

Pull Request check-list

Please make sure to review and check all of these items:

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?
  • Was the change added to CHANGES file?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Changing the default value for ssl_check_hostname to True, to ensure security validations are not skipped by default

@petyaslavova petyaslavova added the breakingchange API or Breaking Change label Apr 30, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR changes the default value for ssl_check_hostname from False to True to enforce stricter security validations by default. Key changes include updating the default in production code (in redis/connection.py, redis/client.py, and their asyncio equivalents) while tests and examples explicitly override the value for backward compatibility or simulation of insecure scenarios.

  • Production connection and client constructors now default to ssl_check_hostname=True.
  • Tests and examples explicitly pass ssl_check_hostname=False to simulate non-secure connections.
  • Documentation examples have been updated to reflect the new production default.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

File Description
tests/test_ssl.py Added explicit override of ssl_check_hostname for SSL connection tests
tests/test_connect.py; test_asyncio files Modified connection parameter overrides to include ssl_check_hostname=False in tests
redis/connection.py, redis/client.py, etc. Updated default ssl_check_hostname parameter from False to True
docs/examples/ssl_connection_examples.ipynb Updated examples to include ssl_check_hostname parameter explicitly
Comments suppressed due to low confidence (1)

redis/connection.py:1031

  • Changing the default to True enhances security by ensuring hostname validation; verify that any integrations or custom overrides still function as expected.
ssl_check_hostname: bool = True,

@petyaslavova petyaslavova force-pushed the ps_change_ssl_check_hostname_default_value_to_true branch from a39dd82 to fc0e050 Compare April 30, 2025 15:53
@petyaslavova petyaslavova merged commit 120517f into master Apr 30, 2025
41 checks passed
@petyaslavova petyaslavova deleted the ps_change_ssl_check_hostname_default_value_to_true branch April 30, 2025 18:10
petyaslavova added a commit that referenced this pull request Apr 30, 2025
…security validations are not skipped by default (#3626)

* Changing the default value for ssl_check_hostname to True, to ensure security validations  are not skipped by default

* Applying review comments

* Removing unused operation in tests.

* Removing unneeded comment from tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breakingchange API or Breaking Change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants