Connection failed to a SQL Server database using Windows authentication from non-Windows OSes

Connection failed to a SQL Server database using Windows authentication from non-Windows OSes

Description/Symptoms

Issue

Connecting to a SQL Server database using Windows Authentication works on Windows, but fails on non-Windows systems (macOS/Linux) when using a JDBC connection with integratedSecurity=true.

How to replicate the issue (step-by-step)

  1. On macOS or Linux, configure a JDBC connection to SQL Server using Windows Authentication (Integrated Security), for example, with:

    • integratedSecurity=true

    • without explicitly setting authenticationScheme

  2. Attempt the connection from your client application.

  3. Result: the connection fails.

Error message 

Error message(s): Connection failed on non-Windows OS (Mac/Linux) Connection failed 'encrypt' property is set to 'true' and 'trustServerCertificate' property is set to 'false' but the driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption: Error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target. ClientConnectionId:f971d1f3-e35c-493d-80b4-38ebe2ddb05d

Environment

  • Product: WTab

  • Client application types:  Tableau


Cause

  1. Integrated Security on macOS/Linux cannot use native Windows authentication (DLL-based).
    Native Windows Authentication relies on Windows-specific components (DLLs) and is not compatible with Linux/macOS.

  2. JDBC default behavior can trigger the wrong authentication method.
    If integratedSecurity=true is set without explicitly settingauthenticationScheme, the driver may default to native Windows authentication, which fails on non-Windows platforms.

  3. The SSL/PKIX error usually means the SQL Server certificate isn’t trusted by the client JVM.
    On macOS/Linux, the Java truststore may not contain the certificate chain used by SQL Server, causing the connection handshake to fail when encrypt=true and trustServerCertificate=false.

Resolution

Step 1 — Confirm Kerberos is available and configured on the client (macOS/Linux)

Because DLL-based authentication is not available, the cross-platform path is Kerberos.

Confirm with the customer that Kerberos is set up, for example:

  • A valid Kerberos configuration file is present (krb5.conf / /etc/krb5.conf)

  • The user can obtain a ticket (e.g., kinit succeeds)

  • The realm/KDC settings are correct

  • If using keytabs, the keytab is present and valid

Optional guidance (high level) — Kerberos on macOS/Linux

  • Install/enable Kerberos client tools (common on Linux; on macOS, it’s typically available or installable).

  • Configure krb5.conf with the correct realm and KDC.

  • Obtain a Kerberos ticket (kinit user@REALM) or configure a keytab for non-interactive use.

  • Ensure DNS/SPN alignment is correct for SQL Server Kerberos authentication.

Exact Kerberos deployment steps depend on the customer’s domain/identity setup, so this is typically handled with their IT/security team.

Step 2 — Update the JDBC URL to use Kerberos explicitly

Set authenticationScheme=JavaKerberos explicitly.

Example JDBC URL:

jdbc:sqlserver://[serverName]:[portNumber];
authenticationScheme=JavaKerberos;
integratedSecurity=true;
domain=[domainName];
databaseName=[databaseName];
encrypt=true;
trustServerCertificate=true;

Notes

  • authenticationScheme=JavaKerberos is the key change for macOS/Linux.

  • The SSL settings depend on the customer's security requirements (see Step 3).


If the error includes PKIX path building failed, use one of these approaches:

Option A (recommended): Import the SQL Server certificate chain into the JVM truststore

  1. Obtain the SQL Server certificate (and intermediate/root certificates if applicable).

  2. Import them into the Java truststore used by the client/tool.

  3. Keep:

    • encrypt=true

    • trustServerCertificate=false (more secure)

Option B (quick workaround): Temporarily set trustServerCertificate=true

  • This bypasses certificate validation and may be acceptable for testing, but it is less secure than Option A.


Additional information 

  • This KBA targets non-Windows clients (macOS/Linux) attempting to use Windows Authentication with SQL Server over JDBC.

    • Related Articles

    • Connection Failed error when configuring Tableau Server Connection in context variable

      Condition When trying to set up Tableau Server connection details in Context Variables, error message pops up, when clicking the Test Connection button. Error message: Connection failed. Response seems not originated from Tableau Server. Use Single ...
    • Failed to Load Chrome Extensions

      Condition When running a test or trying to do a Snapshot the following error message pops up. Error message: Failed to load extension from: /myfolder/org.Chromium.nMpyHa.internal. Loading of unpacked extensions is disabled by the administrator.Copy ...
    • Assert Extract Refresh Task fails with error code 403

      Symptoms The Assert Extract Refresh task fails with the following error message: Data Source Error: clj-http: status 403. Cause The Tableau Metadata API is disabled by default on Tableau Server, unlike Tableau Cloud where it is enabled by default. ...
    • Blended filters from secondary data sources are not recognized by the Tableau Embedding API.

      Summary When attempting to set a filter located in a secondary data source using WTAB, the task fails because Tableau is unable to locate the filter. Symptoms Filters applied on secondary (blended) data sources are detected in snapshots but cannot be ...
    • Empty Hardware Fingerprint

      Condition In the License tab of the Designer settings, the Hardware Fingerprint field is empty. Solution This Hardware Fingerprint is retrieved using the CLI: Make sure that the CLI exists in the "<Wiiisdom-Ops-for-Tableau-home>/kinesis-cli/" folder ...