V
V
Vladimir2014-03-21 21:12:19
IIS
Vladimir, 2014-03-21 21:12:19

IIS C# - how to fix error when connecting to MS SQL provider: SSL, error:0 ?

The complete error sounds like "The connection to the server was successfully established, but then an error occurred while logging in (provider: SSL Provider, error: 0 - An invalid handle was provided)"
To connect, use the line Data Source=tcp:xxxx;Initial Catalog=bd_name;Persist Security Info=True;User Id=saturn;Password=password;MultipleActiveResultSets=True
Both our program and the built-in browser (Database Manager) in IIS 8 cause this error.
But, surprisingly, SQL Manager for SQL Server (portable, lite edition ) connects fine.
I beg you: tell me in which direction to dig?
Software: IIS 8, Windows Server 2012, MS SQL 2012 Standard.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
P
Pavel Vasterov, 2014-03-26
@Falendo

1. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\SuperSocketNetLib should be there, but the Force Protocol Encryption parameter may not be there (this is normal). on the sql server side
2. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\ MSSQL11.MSSQLSERVER \MSSQLServer\SuperSocketNetLib
"ForceEncryption"=dword:00000000
"HideInstance"=dword:00000000
"Certificate"=""
"ExtendedProtection"=dword:00000000
"MSSQL11.MSSQLSERVER" is the name of your sql instance.
are the parameters worth it?
3. on the iis server - control panel - administration - ODBC data sources, try adding your database to the user DSN, does it work?

P
Pavel Vasterov, 2014-03-25
@zxc80

1. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\SuperSocketNetLib\Encrypt\Force Protocol Encryption what is the value? If 1, then change to 0 and restart the server, did it help? If yes, then the rest of the questions are not important.
2. server and client on different computers?
3. Is cryptographic software used on computers? if so, where, client computer, sql server?

V
Vladimir, 2014-03-26
@Falendo

1. Is it looking at mssql server side or iis side? (we did not find these branches).
2. Stand on different databases and iis on different servers.
3. there is no such thing.
I'm most interested in why SQL Manager for SQL Server is connecting.

E
efro, 2020-11-21
@efro

my connection string looks like this:
"Data Source=DESKTOP-Qasd11O\\Sasd01;Database=Kourse;User ID=user;Password=123;Connect Timeout=30;Encrypt=False; TrustServerCertificate=True; ApplicationIntent=ReadWrite;MultiSubnetFailover=False ",
fixing TrustServerCertificate=false to true helped

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question