From b4597ea61839e5323c8e0e8e63fd137509f99023 Mon Sep 17 00:00:00 2001 From: shawleeo Date: Thu, 14 May 2026 12:20:39 -0700 Subject: [PATCH] fix: default MSSQL SSL mode to disable and handle missing SSL config (#41627) --- .../main/java/com/external/plugins/MssqlPlugin.java | 13 ++++--------- .../mssqlPlugin/src/main/resources/form.json | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/app/server/appsmith-plugins/mssqlPlugin/src/main/java/com/external/plugins/MssqlPlugin.java b/app/server/appsmith-plugins/mssqlPlugin/src/main/java/com/external/plugins/MssqlPlugin.java index c546fa03c856..008e1603859b 100644 --- a/app/server/appsmith-plugins/mssqlPlugin/src/main/java/com/external/plugins/MssqlPlugin.java +++ b/app/server/appsmith-plugins/mssqlPlugin/src/main/java/com/external/plugins/MssqlPlugin.java @@ -643,20 +643,15 @@ private static HikariDataSource createConnectionPool( private static void addSslOptionsToUrlBuilder( DatasourceConfiguration datasourceConfiguration, StringBuilder urlBuilder) throws AppsmithPluginException { /* - * - Ideally, it is never expected to be null because the SSL dropdown is set to a initial value. + * - When SSL configuration is absent, default to disabling encryption so that + * connections to servers that do not require encryption work out of the box. */ 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; } - - /* - * - By default, the driver configures SSL in the no verify mode. - */ SSLDetails.AuthType sslAuthType = datasourceConfiguration.getConnection().getSsl().getAuthType(); switch (sslAuthType) { diff --git a/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/form.json b/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/form.json index 7731ac9421aa..9cacb47d1b7b 100644 --- a/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/form.json +++ b/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/form.json @@ -82,7 +82,7 @@ "label": "SSL mode", "configProperty": "datasourceConfiguration.connection.ssl.authType", "controlType": "DROP_DOWN", - "initialValue": "NO_VERIFY", + "initialValue": "DISABLE", "options": [ { "label": "Disable",