Fix SSL hostname verification bug and update env var names #83
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.
Summary
This PR fixes a bug that causes SSL connections to fail with the error "Cannot set verify_mode to CERT_NONE when check_hostname is enabled" when using
REDIS_SSL_CERT_REQS=none. It also corrects inconsistent environment variable naming in the documentation.1. SSL Hostname Verification Bug Fix
Problem: When setting
REDIS_SSL_CERT_REQS=none, the server would crash with:This happens because Python's SSL library requires that when
verify_mode=ssl.CERT_NONE, thecheck_hostnameparameter must also be set toFalse.Use Case: This is essential for scenarios like AWS SSM port forwarding, where:
localhost:6379(via the tunnel)localhost ≠ aws-hostname.amazonaws.comSolution: Added
REDIS_SSL_CHECK_HOSTNAMEconfiguration that:FalsewhenREDIS_SSL_CERT_REQS=noneredis-cli --insecure2. Environment Variable Naming Fixes
Fixed inconsistencies in
.env.example,README.md, andsmithery.yamlwhere some SSL variables were missing theSSL_prefix:REDIS_CA_PATH→REDIS_SSL_CA_PATHREDIS_CERT_REQS→REDIS_SSL_CERT_REQSREDIS_CA_CERTS→REDIS_SSL_CA_CERTSThese now match the actual variable names used in
src/common/config.py.Changes
REDIS_SSL_CHECK_HOSTNAMEconfiguration option toconfig.pycert_reqs="none"ssl_check_hostnamesupport inparse_redis_uri()for URI-based configssl_check_hostnameto both Redis and RedisCluster connectionsTest Plan
REDIS_SSL_CERT_REQS=noneno longer crashesredis-cli --tls --insecurebehavior is matchedssl_check_hostnameconfigurationRelated
This addresses the issue discovered while debugging AWS SSM port forwarding connections where the certificate hostname doesn't match the forwarded localhost address.