Skip to content

fix(Microsoft SQL Node): Fix TLS error when the IP is used to connect to the server - #37870

Open
RomanDavydchuk wants to merge 3 commits into
masterfrom
node-5878-community-issue-mssql-credential-tls-error
Open

fix(Microsoft SQL Node): Fix TLS error when the IP is used to connect to the server#37870
RomanDavydchuk wants to merge 3 commits into
masterfrom
node-5878-community-issue-mssql-credential-tls-error

Conversation

@RomanDavydchuk

@RomanDavydchuk RomanDavydchuk commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Microsoft SQL connections through an IP address fail when TLS is enabled on Node.js 25 or newer. The current tedious driver (used by mssql library) uses the configured IP address as the TLS Server Name Indication (SNI). SNI only accepts hostnames. Older Node.js versions emitted a warning, but newer versions reject the connection. This updates mssql to 12.7.0 and pins tedious to 20.0.5, which contains the upstream fix. The updated driver omits SNI for IP addresses while continuing to validate the server certificate. Hostname-based connections keep their existing behavior.

Changes in the library

Two breaking changes introduced by updating mssql to 12.7.0 do not affect n8n:

  • mssql 11 requires Node.js 18 or newer, which n8n already exceeds
  • mssql 12 no longer clones connection configuration objects, but n8n creates a new configuration for each pool and does not modify it afterward

Extra changes

This PR also converts raw credential data to numbers for port, connectionTimeout and requestTimeout fields. This is due to a bug introduced recently where values from numeric input fields are returned as string. A bug report is already created: https://linear.app/n8n/issue/ADO-5879/

How to test

  1. Launch MS SQL server with TLS (see Linear for instructions)
  2. Launch n8n with Node.js 26: nvm i 26 && nvm use 26
  3. Create credentials for MS SQL server:
    • Server: 127.0.0.1 (important: use the IP)
    • Database: master
    • User: sa
    • Password: your password
    • Port: 1433
    • TLS: enabled
    • Ignore SSL Issues (Insecure): disabled
  4. Try saving the credentials and running a simple query: SELECT 1;
    • Prior to the fix you get the error (... Setting the TLS ServerName to an IP address is not permitted. ...)
    • After the fix it succeeds
  5. Make sure the node still works as expected by playing around with a workflow provided in the Linear ticket

Related Linear tickets, Github issues, and Community forum posts

Fixes #37675
https://linear.app/n8n/issue/NODE-5878/community-issue-mssql-credential-tls-error

Review / Merge checklist

  • I have seen this code, I have run this code, and I take responsibility for this code.
  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)

Review in cubic

@n8n-assistant

n8n-assistant Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

PR review overview

Based on ownership of the 5 changed files in this PR:

Ownership Files owned Share Source code Test files Misc
@n8n-io/catalysts 2 40% +1 / -0 +0 / -0 +89 / -72
@n8n-io/nodes 3 60% +8 / -4 +25 / -0 +0 / -0
Total 5 100% +9 / -4 +25 / -0 +89 / -72

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files

Shadow auto-approve: would not auto-approve because issues were found.

Fix all with cubic | Re-trigger cubic

Comment thread packages/nodes-base/nodes/Microsoft/Sql/GenericFunctions.ts Outdated
Comment thread packages/nodes-base/nodes/Microsoft/Sql/GenericFunctions.ts Outdated
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@n8n-assistant n8n-assistant Bot added n8n team Authored by the n8n team node/improvement New feature or request labels Sep 4, 2026
@RomanDavydchuk
RomanDavydchuk marked this pull request as ready for review September 4, 2026 14:32
@Joffcom
Joffcom requested a review from elsmr September 4, 2026 14:32

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would not auto-approve. Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed n8n team Authored by the n8n team node/improvement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MSSQL Credential TLS Error

1 participant