fix(redis): harden TLS tests and surface TLS config at startup
Isolate Redis TLS unit tests from parent-process env vars and log REDIS_USE_TLS settings at boot so misconfiguration is easier to spot.
This commit is contained in:
@@ -89,6 +89,8 @@ var startupEnvVars = []envVarSpec{
|
||||
// Cache / queue
|
||||
{name: "REDIS_ADDR"},
|
||||
{name: "REDIS_PASSWORD", sensitive: true},
|
||||
{name: "REDIS_USE_TLS"},
|
||||
{name: "REDIS_TLS_SERVER_NAME"},
|
||||
// Object storage
|
||||
{name: "STORAGE_TYPE"},
|
||||
{name: "MINIO_ENDPOINT"},
|
||||
@@ -137,6 +139,10 @@ func LogStartupEnv(ctx context.Context) {
|
||||
"[startup-env] SYSTEM_AES_KEY is set but %d bytes long; AES-256 requires exactly 32 bytes — encryption is DISABLED",
|
||||
len(k))
|
||||
}
|
||||
if strings.EqualFold(strings.TrimSpace(os.Getenv("REDIS_TLS_INSECURE_SKIP_VERIFY")), "true") {
|
||||
logger.Warn(ctx,
|
||||
"[startup-env] REDIS_TLS_INSECURE_SKIP_VERIFY=true — Redis TLS certificate verification is DISABLED; do not use in production")
|
||||
}
|
||||
}
|
||||
|
||||
func formatEnvValue(s envVarSpec, val string) string {
|
||||
|
||||
Reference in New Issue
Block a user