From a3dae65bcbf572b02a36996b91d13d49036abb30 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 27 Nov 2024 22:47:07 +0100 Subject: Add support for connecting to redis via TLS --- internal/server/tls.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'internal/server/tls.go') diff --git a/internal/server/tls.go b/internal/server/tls.go index 1c1073e..0fb6c48 100644 --- a/internal/server/tls.go +++ b/internal/server/tls.go @@ -24,6 +24,8 @@ type redisConfig struct { Password string `conf:"required"` EncryptionKey string `conf:"required"` KeyPrefix string `conf:"default:certmagic"` + TLSEnabled bool `conf:"default:false,env:TLS_ENABLED"` + TLSInsecure bool `conf:"default:false,env:TLS_INSECURE"` } func (s *Server) serveTLS() (err error) { @@ -101,6 +103,8 @@ func (s *Server) serveTLS() (err error) { rs.Password = rc.Password rs.EncryptionKey = rc.EncryptionKey rs.KeyPrefix = rc.KeyPrefix + rs.TlsEnabled = rc.TLSEnabled + rs.TlsInsecure = rc.TLSInsecure cfg.Storage = rs err = rs.Provision(caddy.Context{ -- cgit 1.4.1