From 0edc1669be1b31c40393d561d45d90fa56868c4a Mon Sep 17 00:00:00 2001 From: Emily Matheys Date: Wed, 5 Jun 2024 13:29:57 +0300 Subject: [PATCH] Allow sentinel tls --- src/client/blocking.rs | 10 +++++++++- src/connection_info/mod.rs | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/client/blocking.rs b/src/client/blocking.rs index f7feb81..16c3650 100644 --- a/src/client/blocking.rs +++ b/src/client/blocking.rs @@ -114,7 +114,15 @@ pub(crate) fn get_sentinel_client( vec![connection_info.to_owned()], name.to_string(), Some(redis::sentinel::SentinelNodeConnectionInfo { - tls_mode: None, + tls_mode: match connection_info.addr { + redis::ConnectionAddr::TcpTls { insecure: true, .. } => { + Some(redis::TlsMode::Insecure) + } + redis::ConnectionAddr::TcpTls { + insecure: false, .. + } => Some(redis::TlsMode::Secure), + _ => None, + }, redis_connection_info: Some(connection_info.redis.clone()), }), redis::sentinel::SentinelServerType::Master, diff --git a/src/connection_info/mod.rs b/src/connection_info/mod.rs index ebafbde..a54e42b 100644 --- a/src/connection_info/mod.rs +++ b/src/connection_info/mod.rs @@ -72,7 +72,7 @@ impl TryFrom<&str> for FalkorConnectionInfo { ); match scheme.as_str() { - "redis" | "rediss" => { + "redis" | "rediss" | "redis+unix" => { #[cfg(feature = "redis")] return Ok(FalkorConnectionInfo::Redis( redis::IntoConnectionInfo::into_connection_info(serialized)