Skip to content

fix: default rediss:// to standalone TLS, make cluster mode opt-in#1

Open
noamsuissa01 wants to merge 1 commit into
masterfrom
fix/standalone-tls-mode
Open

fix: default rediss:// to standalone TLS, make cluster mode opt-in#1
noamsuissa01 wants to merge 1 commit into
masterfrom
fix/standalone-tls-mode

Conversation

@noamsuissa01
Copy link
Copy Markdown
Collaborator

Summary

rediss:// (TLS) URLs no longer force ioredis.Cluster mode. The previous behavior crashed the app on every non-clustered TLS Redis/Valkey provider with ClusterAllFailedError: Failed to refresh slots cache. Cluster mode is now opt-in via sails.config.redis_cluster_mode = true.

Breaking Changes

  • Default for rediss:// is now standalone mode. Set sails.config.redis_cluster_mode = true (env: sails_redis_cluster_mode=true) to restore the old cluster behavior.
  • TLS cert verification defaults to true (was hardcoded false). Set sails.config.redis_tls_reject_unauthorized = false if needed.

Provider Compatibility

Provider Mode needed
DigitalOcean Managed Valkey standalone (default)
Redis Cloud Essentials standalone (default)
Upstash standalone (default)
AWS ElastiCache (non-cluster) standalone (default)
Azure Redis Basic/Standard standalone (default)
Azure Redis Premium (clustered) redis_cluster_mode: true
AWS ElastiCache (cluster mode) redis_cluster_mode: true

Changes

  • New sails.config.redis_cluster_mode option — opt-in for clustered deployments
  • New sails.config.redis_tls_reject_unauthorized option — configurable TLS cert verification
  • Extracted attachKueMethods() helper — eliminates duplication between standalone and cluster paths
  • Split monolithic SSL handler into createStandaloneClient() and createClusterClient()
  • Updated README with full config docs and breaking changes section
  • Version bump: 0.0.12 → 0.1.0

How to Test

Standalone TLS (new default)

// config/env/production.js
module.exports = {
  redis_url: 'rediss://user:pass@your-managed-redis:25061/0',
};

Expect logs: Kue Redis: using ioredis standalone with TLSKue Redis standalone connectedKue Redis standalone ready

Cluster TLS (opt-in)

module.exports = {
  redis_url: 'rediss://user:pass@your-clustered-redis:6380/0',
  redis_cluster_mode: true,
};

Expect logs: Kue Redis: using ioredis Cluster with TLSKue Redis Cluster connectedKue Redis Cluster ready

Plain Redis (unchanged)

module.exports = {
  redis_url: 'redis://localhost:6379',
};

No change in behavior — URL passed directly to kue.

🤖 Generated with Claude Code

BREAKING CHANGE: rediss:// URLs now default to standalone ioredis with
TLS instead of forcing ioredis.Cluster. The previous behavior crashed
the app on every non-clustered TLS provider (DO Managed Valkey, Redis
Cloud Essentials, Upstash, ElastiCache non-cluster, Azure Basic/Standard)
with ClusterAllFailedError: Failed to refresh slots cache.

New config options:
- sails.config.redis_cluster_mode (env: sails_redis_cluster_mode)
  Set to true to restore the old Cluster behavior for clustered
  deployments (e.g., Azure Premium with clustering enabled).

- sails.config.redis_tls_reject_unauthorized
  TLS cert verification now defaults to true (was hardcoded false).
  Set to false for self-signed certs in development.

Other improvements:
- Extracted attachKueMethods() to eliminate code duplication
- Split client creation into createStandaloneClient/createClusterClient
- Added full config documentation to README with provider compatibility table

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@noamsuissa01 noamsuissa01 requested a review from chintan13 April 16, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant