diff --git a/crates/deadpool-redis/src/lib.rs b/crates/deadpool-redis/src/lib.rs index 602fffee..9b086689 100644 --- a/crates/deadpool-redis/src/lib.rs +++ b/crates/deadpool-redis/src/lib.rs @@ -145,6 +145,22 @@ impl Manager { ping_number: AtomicUsize::new(0), }) } + + /// Creates a new [`Manager`] from the given `params` and TLS certificates.` + /// + /// # Errors + /// + /// If establishing a new [`Client`] fails. + #[cfg(feature = "tls-rustls")] + pub fn from_tls_certificates( + params: T, + tls_certs: redis::TlsCertificates, + ) -> RedisResult { + Ok(Self { + client: Client::build_with_tls(params, tls_certs)?, + ping_number: AtomicUsize::new(0), + }) + } } impl managed::Manager for Manager {