SQL Server with TLS 1.2 from .NET Core with ODBC

0

I know this has come up a million times, but apparently not with .NET Core using System.Data.Odbc.

With TLS 1.0 turned of in the registry, I get an error:

{System.Data.Odbc.OdbcException (0x80131937): ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SSL Security error

ERROR [01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (SECDoClientHandshake()).

I get that error when running the ASP.NET Core site on the server that hosts SQL Server, but also using a dev machine on a Windows 10 client, connecting to the remote SQL Server.

SSMS runs and connects fine both on the server and on the client. When I switch on TLS 1.0 support, and restart SQL Server, the site runs fine on both the server and the client. (No need to reboot to see the difference).

To be sure I have enabled the FIPS support, even though I read somewhere that this is no longer needed.

This is the configuration:

  • Windows Server 2016 (up to date)
  • SQL Server 2016 SP2 with the latest updates
  • Just to be sure, I also installed .NET 4.7 even though I don't use that.

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

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

My suspicion is that the System.Data.Odbc for .NET Standard 2.0 does not support 1.2. I would love to get some help and pointers.

[EDIT] @TallTed this is what is installed, it should support TLS 1.2:

  • Microsoft SQL Server 2012 Native Client with version 11.4.7001.0
  • Microsoft ODBC Driver 17 for SQL Server with version 17.3.1.1
  • Microsoft ODBC Driver 11 for SQL Server with version 12.2.5543.11
  • Microsoft ODBC Driver 13 for SQL Server with version 14.0.1000.169
sql-server
odbc
tls1.2
asp.net-core-2.2
tls1.0
asked on Stack Overflow Feb 22, 2019 by Pieter van Kampen • edited Feb 25, 2019 by TallTed

1 Answer

-1

System.Data.Odbc is not the issue; [Microsoft][ODBC SQL Server Driver][DBNETLIB] is.

The solution is to get (or confirm you're using) a more recent ODBC Driver for SQL Server, from Microsoft or from my employer or from another vendor...

answered on Stack Overflow Feb 22, 2019 by TallTed • edited Feb 25, 2019 by TallTed

User contributions licensed under CC BY-SA 3.0