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]
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