Skip to content

fix(client): allow boolean tls and TLS connection options on socket c… - #3487

Open
codeXsidd wants to merge 1 commit into
redis:masterfrom
codeXsidd:fix/socket-options-types-3113
Open

codeXsidd wants to merge 1 commit into
redis:masterfrom
codeXsidd:fix/socket-options-types-3113

Conversation

@codeXsidd

@codeXsidd codeXsidd commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

…onfig (#3113)

Description

Describe your pull request here


Checklist

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

Note

Medium Risk
Changes public socket option types and documents TLS-related configs, but connection selection logic is unchanged and limited to typing plus tests.

Overview
Fixes TypeScript complaints for the common Heroku-style setup where socket.tls is a boolean (e.g. derived from rediss: in REDIS_URL) and TLS fields like rejectUnauthorized: false are set on the same object (#3113 / #3023).

RedisTlsOptions is reworked so TLS settings can sit alongside normal TCP connect options (noDelay, keepAlive, host, port, etc.) with tls optional/boolean, instead of requiring a literal tls: true discriminator. RedisIpcOptions no longer forces tls: false when using a Unix path. Several socket option types are exported for consumers and compile-time checks.

The TLS socket factory typing is cleaned up (intersection of tls.ConnectionOptions and net.TcpNetConnectOpts) so TCP defaults no longer need @ts-expect-error. Runtime behavior for opening TLS still keys off options.tls === true; new parseOptions and types-tests lock in Heroku patterns and rediss:// URLs with TLS options but no explicit tls flag.

Reviewed by Cursor Bugbot for commit 4fbd0d7. Bugbot is set up for automated code reviews on this repo. Configure here.

Copilot AI balanced review requested due to automatic review settings October 2, 2026 17:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

2 participants