Skip to content

fix: default MSSQL SSL mode to disable and handle missing SSL config (#41627)#41818

Open
xiyaoeva wants to merge 1 commit into
appsmithorg:releasefrom
xiyaoeva:fix/41627-mssql-ssl-handshake-failure
Open

fix: default MSSQL SSL mode to disable and handle missing SSL config (#41627)#41818
xiyaoeva wants to merge 1 commit into
appsmithorg:releasefrom
xiyaoeva:fix/41627-mssql-ssl-handshake-failure

Conversation

@xiyaoeva
Copy link
Copy Markdown

@xiyaoeva xiyaoeva commented May 14, 2026

Description

TL;DR

MSSQL datasource now defaults SSL mode to DISABLE instead of NO_VERIFY, and missing SSL config no longer throws an exception; it falls back to encrypt=false; so non-encrypted servers can connect successfully.

Motivation / Context

When connecting to MSSQL servers that do not require encryption, connection tests could fail due to SSL handshake errors.
Root causes:

  1. New datasource default SSL mode was NO_VERIFY (which sets encrypt=true).
  2. Missing SSL config path threw a plugin exception instead of applying a fallback.

This caused avoidable failures for common MSSQL setups where encryption is not enforced.

Changes

  1. Updated MSSQL form default SSL mode:
  • app/server/appsmith-plugins/mssqlPlugin/src/main/resources/form.json
  • "initialValue": "NO_VERIFY" -> "initialValue": "DISABLE"
  1. Updated MSSQL plugin SSL handling:
  • app/server/appsmith-plugins/mssqlPlugin/src/main/java/com/external/plugins/MssqlPlugin.java
  • When SSL config/auth type is missing, use fallback:
    • append encrypt=false;
    • return;
  • Removed exception throw in that missing-config path.

Why this is safe

  • Does not remove SSL support.
  • Users who need SSL can still explicitly choose SSL-enabled options.
  • Improves compatibility for legacy/API-created datasources with missing SSL config.

Dependencies

None.

Related docs/design links

None.

Fixes #41627

Automation

/ok-to-test tags=""

🔍 Cypress test results

Caution

If you modify the content in this section, you are likely to disrupt the CI result for your PR.

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Bug Fixes
    • Improved MSSQL database connection SSL configuration handling. The system now gracefully defaults to encryption disabled when SSL settings are incomplete, preventing connection failures.
    • Updated the default SSL mode setting from NO_VERIFY to DISABLE for new MSSQL database connections.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

Walkthrough

The MSSQL plugin's SSL configuration handling is updated to default gracefully when configuration is absent. The Java code now appends encrypt=false; and returns instead of throwing an exception. The form configuration synchronously updates its default SSL mode from NO_VERIFY to DISABLE.

Changes

MSSQL SSL Configuration Default

Layer / File(s) Summary
Default SSL configuration behavior and form alignment
app/server/appsmith-plugins/mssqlPlugin/src/main/java/com/external/plugins/MssqlPlugin.java, app/server/appsmith-plugins/mssqlPlugin/src/main/resources/form.json
addSslOptionsToUrlBuilder treats missing SSL configuration as non-error, defaulting to encrypt=false;. The form's SSL mode initialValue shifts from NO_VERIFY to DISABLE to match the new default behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🔐 When SSL is nowhere to be found,
No exceptions thrown, just safe and sound,
Encrypt=false becomes the way,
Form defaults brighten the day! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning PR changes (MSSQL SSL handling) are unrelated to linked issue #41627 (SeaTable native plugin implementation). Verify that issue #41627 is correctly linked, or link this PR to the actual MSSQL SSL issue it addresses.
Out of Scope Changes check ⚠️ Warning PR modifies MSSQL plugin SSL configuration and behavior, but linked issue #41627 concerns SeaTable plugin implementation—scope mismatch. Either link to the correct MSSQL SSL issue or verify that SeaTable changes are also included in this PR.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly describes the main change: defaulting MSSQL SSL mode and handling missing SSL configuration.
Description check ✅ Passed Description is comprehensive with TL;DR, motivation, detailed changes, safety rationale, and proper issue reference (#41627).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@app/server/appsmith-plugins/mssqlPlugin/src/main/java/com/external/plugins/MssqlPlugin.java`:
- Around line 649-653: The code currently treats a missing ssl.authType the same
as a missing SSL block and silently appends "encrypt=false" to urlBuilder;
instead, only default to "encrypt=false" when the entire SSL block is absent
(datasourceConfiguration.getConnection() == null || getSsl() == null). If
getSsl() is present but getAuthType() is null, do not overwrite to
plaintext—either throw an IllegalArgumentException or log an explicit error and
abort building the URL so callers can correct the malformed/partial config;
update the logic around datasourceConfiguration.getConnection(),
datasourceConfiguration.getConnection().getSsl(),
datasourceConfiguration.getConnection().getSsl().getAuthType(), and the
urlBuilder usage accordingly so partially populated SSL configs are rejected
rather than silently downgraded.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9eaa8390-4d32-4e51-b44c-7f9e76f135b1

📥 Commits

Reviewing files that changed from the base of the PR and between d75495a and b4597ea.

📒 Files selected for processing (2)
  • app/server/appsmith-plugins/mssqlPlugin/src/main/java/com/external/plugins/MssqlPlugin.java
  • app/server/appsmith-plugins/mssqlPlugin/src/main/resources/form.json

Comment on lines 649 to +653
if (datasourceConfiguration.getConnection() == null
|| datasourceConfiguration.getConnection().getSsl() == null
|| datasourceConfiguration.getConnection().getSsl().getAuthType() == null) {
throw new AppsmithPluginException(
AppsmithPluginError.PLUGIN_ERROR,
"Appsmith server has failed to fetch SSL configuration from datasource configuration form. "
+ "Please reach out to Appsmith customer support to resolve this.");
urlBuilder.append("encrypt=false;");
return;
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Don't silently downgrade partially populated SSL configs.

Defaulting to encrypt=false when the entire SSL block is absent makes sense here, but doing the same for ssl.authType == null can turn a malformed or partially migrated secure config into plaintext without any signal.

Suggested adjustment
-        if (datasourceConfiguration.getConnection() == null
-                || datasourceConfiguration.getConnection().getSsl() == null
-                || datasourceConfiguration.getConnection().getSsl().getAuthType() == null) {
+        if (datasourceConfiguration.getConnection() == null
+                || datasourceConfiguration.getConnection().getSsl() == null) {
             urlBuilder.append("encrypt=false;");
             return;
         }
+        if (datasourceConfiguration.getConnection().getSsl().getAuthType() == null) {
+            throw new AppsmithPluginException(
+                    AppsmithPluginError.PLUGIN_ERROR,
+                    "Missing MSSQL SSL mode in datasource configuration.");
+        }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (datasourceConfiguration.getConnection() == null
|| datasourceConfiguration.getConnection().getSsl() == null
|| datasourceConfiguration.getConnection().getSsl().getAuthType() == null) {
throw new AppsmithPluginException(
AppsmithPluginError.PLUGIN_ERROR,
"Appsmith server has failed to fetch SSL configuration from datasource configuration form. "
+ "Please reach out to Appsmith customer support to resolve this.");
urlBuilder.append("encrypt=false;");
return;
if (datasourceConfiguration.getConnection() == null
|| datasourceConfiguration.getConnection().getSsl() == null) {
urlBuilder.append("encrypt=false;");
return;
}
if (datasourceConfiguration.getConnection().getSsl().getAuthType() == null) {
throw new AppsmithPluginException(
AppsmithPluginError.PLUGIN_ERROR,
"Missing MSSQL SSL mode in datasource configuration.");
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@app/server/appsmith-plugins/mssqlPlugin/src/main/java/com/external/plugins/MssqlPlugin.java`
around lines 649 - 653, The code currently treats a missing ssl.authType the
same as a missing SSL block and silently appends "encrypt=false" to urlBuilder;
instead, only default to "encrypt=false" when the entire SSL block is absent
(datasourceConfiguration.getConnection() == null || getSsl() == null). If
getSsl() is present but getAuthType() is null, do not overwrite to
plaintext—either throw an IllegalArgumentException or log an explicit error and
abort building the URL so callers can correct the malformed/partial config;
update the logic around datasourceConfiguration.getConnection(),
datasourceConfiguration.getConnection().getSsl(),
datasourceConfiguration.getConnection().getSsl().getAuthType(), and the
urlBuilder usage accordingly so partially populated SSL configs are rejected
rather than silently downgraded.

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.

feat: Add SeaTable as native data source plugin

1 participant