[PR #558] [MERGED] feat(#450): add Redis SSL/TLS configuration support #580

Closed
opened 2026-02-16 01:16:23 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-daemon/pull/558
Author: @Oscaner
Created: 1/7/2026
Status: Merged
Merged: 1/13/2026
Merged by: @Yeuoly

Base: mainHead: main


📝 Commits (9)

  • ceda7d9 feat(#450): add Redis SSL/TLS configuration support
  • 23af02b fix(#450): prevent reference cycle in TLS config and simplify SSL setup
  • 4eab97f fix(#450): improve Redis TLS certificate verification logic for optional certificates
  • 64cf90e fix(#450): simplify Redis TLS certificate verification logic for optional and required certificates
  • ba67b83 docs(#450): add note for CA certificate file path in Redis SSL configuration
  • 7481fa0 test(#450): add comprehensive tests for Redis TLS configuration
  • 06feed5 fix(#450): enhance Redis SSL configuration documentation and enforce CA cert requirement
  • c12865c fix(#450): add nil TLS parameter to InitRedisClient calls in tests
  • 5c51b9f fix(#450): add default TLS configuration for Redis client when no tlsConf is provided

📊 Changes

12 files changed (+544 additions, -33 deletions)

View changed files

📝 .env.example (+22 -2)
📝 internal/cluster/clutser_test.go (+1 -1)
📝 internal/core/debugging_runtime/server_test.go (+2 -2)
📝 internal/core/persistence/persistence_test.go (+4 -4)
📝 internal/core/plugin_manager/manager.go (+8 -0)
📝 internal/core/session_manager/session_trace_test.go (+1 -1)
📝 internal/service/debugging_service/connection_key_test.go (+1 -1)
📝 internal/types/app/config.go (+61 -7)
internal/types/app/config_test.go (+406 -0)
📝 pkg/utils/cache/redis.go (+31 -8)
📝 pkg/utils/cache/redis_auto_type_test.go (+2 -2)
📝 pkg/utils/cache/redis_test.go (+5 -5)

📄 Description

Description

Add comprehensive SSL/TLS support for Redis connections with configurable certificate verification modes. Introduces new environment variables for SSL configuration including REDIS_USE_SSL, REDIS_SSL_CERT_REQS (supporting CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED), and REDIS_SSL_CA_CERTS for custom CA certificates.

Changes:

  • Add Redis SSL configuration options to .env.example
  • Implement RedisTLSConfig() method to build tls.Config based on environment settings
  • Pass TLS config to both standard Redis and Sentinel mode initializers
  • Support custom CA certificate loading and verification modes
  • Set minimum TLS version to 1.2 for security
  • Minor whitespace cleanup in existing config comments

This enables secure Redis connections in production environments with flexible certificate verification options.

Fixes https://github.com/langgenius/dify-plugin-daemon/issues/450

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • Other

Essential Checklist

Testing

  • I have tested the changes locally and confirmed they work as expected
  • I have added unit tests where necessary and they pass successfully

Bug Fix (if applicable)

  • I have used GitHub syntax to close the related issue (e.g., Fixes #123 or Closes #123)

Additional Information

Please provide any additional context that would help reviewers understand the changes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-plugin-daemon/pull/558 **Author:** [@Oscaner](https://github.com/Oscaner) **Created:** 1/7/2026 **Status:** ✅ Merged **Merged:** 1/13/2026 **Merged by:** [@Yeuoly](https://github.com/Yeuoly) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (9) - [`ceda7d9`](https://github.com/langgenius/dify-plugin-daemon/commit/ceda7d9e60bd4e88b0cca3328ccee6825289e1ec) feat(#450): add Redis SSL/TLS configuration support - [`23af02b`](https://github.com/langgenius/dify-plugin-daemon/commit/23af02b70bf19742f35cf62a0b58b2a86001e488) fix(#450): prevent reference cycle in TLS config and simplify SSL setup - [`4eab97f`](https://github.com/langgenius/dify-plugin-daemon/commit/4eab97fad537eeba7c23ac6ef3b400dc3430f817) fix(#450): improve Redis TLS certificate verification logic for optional certificates - [`64cf90e`](https://github.com/langgenius/dify-plugin-daemon/commit/64cf90ecef1c27d321e43b16c951799d16c0fd66) fix(#450): simplify Redis TLS certificate verification logic for optional and required certificates - [`ba67b83`](https://github.com/langgenius/dify-plugin-daemon/commit/ba67b8382a665029b98e318b12d7dd6317f3f189) docs(#450): add note for CA certificate file path in Redis SSL configuration - [`7481fa0`](https://github.com/langgenius/dify-plugin-daemon/commit/7481fa0c1a8cd0c972ac36adff335136f8c96ef4) test(#450): add comprehensive tests for Redis TLS configuration - [`06feed5`](https://github.com/langgenius/dify-plugin-daemon/commit/06feed5bc22cf9164b4649451d33e9450a1ea577) fix(#450): enhance Redis SSL configuration documentation and enforce CA cert requirement - [`c12865c`](https://github.com/langgenius/dify-plugin-daemon/commit/c12865cb1ebdadc3538409038a30a167c33542d4) fix(#450): add nil TLS parameter to InitRedisClient calls in tests - [`5c51b9f`](https://github.com/langgenius/dify-plugin-daemon/commit/5c51b9f63f491e5fc02db0eddd806b0bbdfb26c9) fix(#450): add default TLS configuration for Redis client when no tlsConf is provided ### 📊 Changes **12 files changed** (+544 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+22 -2) 📝 `internal/cluster/clutser_test.go` (+1 -1) 📝 `internal/core/debugging_runtime/server_test.go` (+2 -2) 📝 `internal/core/persistence/persistence_test.go` (+4 -4) 📝 `internal/core/plugin_manager/manager.go` (+8 -0) 📝 `internal/core/session_manager/session_trace_test.go` (+1 -1) 📝 `internal/service/debugging_service/connection_key_test.go` (+1 -1) 📝 `internal/types/app/config.go` (+61 -7) ➕ `internal/types/app/config_test.go` (+406 -0) 📝 `pkg/utils/cache/redis.go` (+31 -8) 📝 `pkg/utils/cache/redis_auto_type_test.go` (+2 -2) 📝 `pkg/utils/cache/redis_test.go` (+5 -5) </details> ### 📄 Description ## Description Add comprehensive SSL/TLS support for Redis connections with configurable certificate verification modes. Introduces new environment variables for SSL configuration including REDIS_USE_SSL, REDIS_SSL_CERT_REQS (supporting CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED), and REDIS_SSL_CA_CERTS for custom CA certificates. Changes: - Add Redis SSL configuration options to .env.example - Implement RedisTLSConfig() method to build tls.Config based on environment settings - Pass TLS config to both standard Redis and Sentinel mode initializers - Support custom CA certificate loading and verification modes - Set minimum TLS version to 1.2 for security - Minor whitespace cleanup in existing config comments This enables secure Redis connections in production environments with flexible certificate verification options. Fixes https://github.com/langgenius/dify-plugin-daemon/issues/450 ## Type of Change - [ ] Bug fix - [x] New feature - [ ] Refactor - [ ] Performance improvement - [ ] Other ## Essential Checklist ### Testing - [x] I have tested the changes locally and confirmed they work as expected - [x] I have added unit tests where necessary and they pass successfully ### Bug Fix (if applicable) - [x] I have used GitHub syntax to close the related issue (e.g., `Fixes #123` or `Closes #123`) ## Additional Information Please provide any additional context that would help reviewers understand the changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 01:16:23 -05:00
yindo closed this issue 2026-02-16 01:16:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#580