Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Security and hardening

ODBC Driver 18 on Linux cannot connect to an old SQL Server: legacy sigalg disallowed

Your error

[Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:0A00014D:SSL routines::legacy sigalg disallowed or unsupported]2 more lines it can show

Fix it fast

Most common cause, 1 of 2

The client config still carries the OpenSSL 1.1.1 workaround, SECLEVEL=1

Create a separate file with level 0 and point only the process that talks to this SQL Server at it, through the service's environment or the container's ENV.

Fix
sudo tee /etc/ssl/legacy-sqlserver.cnf >/dev/null <<'EOF'
openssl_conf = openssl_init

[openssl_init]
ssl_conf = ssl_sect

[ssl_sect]
system_default = system_default_sect

[system_default_sect]
MinProtocol = TLSv1
CipherString = DEFAULT:@SECLEVEL=0
EOF

# systemd unit of the app:  Environment=OPENSSL_CONF=/etc/ssl/legacy-sqlserver.cnf
# Dockerfile:               ENV OPENSSL_CONF=/etc/ssl/legacy-sqlserver.cnf
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

error:0A00014D legacy sigalg disallowed or unsupported means the SQL Server handshake used SHA-1 or MD5 signatures, which TLS 1.0 and 1.1 need and OpenSSL 3.0 forbids at security level 1 and above. Ubuntu 22.04 and 24.04 and Debian 12 hit it with ODBC Driver 17 or 18. Patch SQL Server for TLS 1.2, or give the app SECLEVEL=0 through OPENSSL_CONF.

  • Applies to Microsoft ODBC Driver 18.7 and 17.11 for SQL Server, OpenSSL 3.0 on Ubuntu 22.04, Ubuntu 24.04 and Debian 12, SQL Server 2008 to 2014 builds without the TLS 1.2 update
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

On the Linux client, print the OpenSSL version and any protocol or security level lines in the config it loads. OpenSSL 3.0 with an old MinProtocol = TLSv1 and SECLEVEL=1 pair points to cause 1. No such lines at all means nothing on the client allows the old handshake, so the server build in cause 2 decides the fix.

Run this first
openssl version
grep -nE "MinProtocol|CipherString|SECLEVEL" "${OPENSSL_CONF:-/etc/ssl/openssl.cnf}"

Then find the line you see in this list and open its fix:

  1. 1The client config still carries the OpenSSL 1.1.1 workaround, SECLEVEL=1openssl version prints 3.0.x and the config already has MinProtocol = TLSv1 with @SECLEVEL=1; the server used to connect before the OS upgrade
  2. 2The SQL Server build or its Windows host never got TLS 1.2@@VERSION shows a build lower than the first TLS 1.2 build Microsoft lists for that release, or Windows Server 2008 R2 without the TLS 1.2 Schannel keys

What does the error look like?

  • [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:0A00014D:SSL routines::legacy sigalg disallowed or unsupported]
  • error:0A00014D:SSL routines:tls_process_key_exchange:legacy sigalg disallowed or unsupported
  • [Microsoft][ODBC Driver 18 for SQL Server]Client unable to establish connection

Cause 1 of 2

The client config still carries the OpenSSL 1.1.1 workaround, SECLEVEL=1

You seeopenssl version prints 3.0.x and the config already has MinProtocol = TLSv1 with @SECLEVEL=1; the server used to connect before the OS upgrade

Check

The ODBC driver reports legacy sigalg disallowed or unsupported here because OpenSSL 3.0 forbids SHA-1 and MD5 signatures from security level 1 upward. A TLS 1.0 or 1.1 handshake cannot be signed any other way, so the level 1 setting that rescued these servers under OpenSSL 1.1.1 now fails one step later. Only level 0 permits everything.

Check
grep -n "SECLEVEL" "${OPENSSL_CONF:-/etc/ssl/openssl.cnf}"

Fix

Create a separate file with level 0 and point only the process that talks to this SQL Server at it, through the service's environment or the container's ENV. Keep the colon in DEFAULT:@SECLEVEL=0. Treat it as temporary, because level 0 also accepts weak keys and ciphers. OpenSSL 3.5 (Ubuntu 26.04, Debian 13) goes further and drops TLS 1.0 and 1.1 at level 1, so the message there differs while the same file still applies.

Fix
sudo tee /etc/ssl/legacy-sqlserver.cnf >/dev/null <<'EOF'
openssl_conf = openssl_init

[openssl_init]
ssl_conf = ssl_sect

[ssl_sect]
system_default = system_default_sect

[system_default_sect]
MinProtocol = TLSv1
CipherString = DEFAULT:@SECLEVEL=0
EOF

# systemd unit of the app:  Environment=OPENSSL_CONF=/etc/ssl/legacy-sqlserver.cnf
# Dockerfile:               ENV OPENSSL_CONF=/etc/ssl/legacy-sqlserver.cnf

Verify

A test login from the same environment returns rows instead of the SSL Provider error.

Verify
OPENSSL_CONF=/etc/ssl/legacy-sqlserver.cnf sqlcmd -S tcp:sql.example.com,1433 -d master -U app_user -P "$SQL_PASSWORD"

Confirmed by docs.openssl.org

Did this fix it?

Cause 2 of 2

The SQL Server build or its Windows host never got TLS 1.2

You see@@VERSION shows a build lower than the first TLS 1.2 build Microsoft lists for that release, or Windows Server 2008 R2 without the TLS 1.2 Schannel keys

Check

Microsoft's TLS 1.2 support article lists, per release, the first SQL Server 2008, 2008 R2, 2012 and 2014 builds that can use TLS 1.2; anything older cannot negotiate TLS 1.2, which leaves a Linux client with TLS 1.0 or 1.1. SQL Server 2016 and later already include it. Run the version query from any client that still connects, such as SSMS on Windows, and compare the build with the table.

Check
SELECT @@VERSION;

Fix

Install the cumulative update or service pack the article names for your release (for SQL Server 2014 that is SP2 or SP3, or the RTM CU12 and SP1 CU5 updates). On Windows Server 2008 R2, also create the TLS 1.2 Client and Server keys under SCHANNEL with Enabled=1 and DisabledByDefault=0, then restart. Afterwards remove the level 0 file from cause 1.

Fix
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client]
"DisabledByDefault"=dword:00000000
"Enabled"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server]
"DisabledByDefault"=dword:00000000
"Enabled"=dword:00000001

Verify

With OPENSSL_CONF unset, the Linux client connects using the stock OpenSSL settings.

Verify
env -u OPENSSL_CONF sqlcmd -S tcp:sql.example.com,1433 -d master -U app_user -P "$SQL_PASSWORD"

Confirmed by learn.microsoft.com

Did this fix it?

How do I stop it coming back?

  • Record the SQL Server build next to the connection string, and check it against Microsoft's TLS 1.2 table before upgrading Linux clients.
  • Ship the level 0 file only in the image or unit for the legacy database connection, never in a base image shared by other services.
  • Add a startup check that logs the OpenSSL version and OPENSSL_CONF value, so a silent change of either shows up in the logs.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.