-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Sentinel TLS: discover_master is not respect connection type. #3128
Comments
I have exactly the same issue! |
I ran into a similar problem, only with authentication. I created a merge request that fixes my issue, and maybe yours also: #3376 |
Don't you fix this by passing the necessary ssl kwargs into the |
Good lord this bug is hard to track down. Thankfully ChatGPT has guided me here so I'm posting my workaround for anyone who also have this issue. First you need this class from redis.connection import SSLConnection
from redis.sentinel import SentinelManagedConnection
class SentinelManagedSSLConnection( SentinelManagedConnection, SSLConnection ):
def __init__( self, *args, **kwargs ):
kwargs.pop( "ssl", None )
super().__init__( *args, **kwargs ) Then you can use it like so s = {
"ssl": True
, "ssl_keyfile": os.path.join( Env.REDIS_CERTS, "key" )
, "ssl_certfile": os.path.join( Env.REDIS_CERTS, "cert" )
, "ssl_ca_certs": os.path.join( Env.REDIS_CERTS, "ca" )
}
sentinelObj.master_for( "mymaster", connection_class=SentinelManagedSSLConnection, **s) Basically |
In case Sentinel configured with TLS , redis_master call fails with error: "Connection reset by peer", means it is not use TLS during function call.
I've checked all docs which I able to found and for me still not clear is it supported or no?
Version: 5.1.0b3
Platform: Python 3.11 MacOS
Description:
SSL were generated self signed.
My simple code:
In sentinel logs
Error accepting a client connection: error:1408F10B:SSL routines:ssl3_get_record:wrong version number (addr=IP:56828 laddr=IP:26380)
The text was updated successfully, but these errors were encountered: