Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/264.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Visual Studio OSX sql server预登录握手失败_C#_Sql_Sql Server_Macos_Visual Studio - Fatal编程技术网

C# Visual Studio OSX sql server预登录握手失败

C# Visual Studio OSX sql server预登录握手失败,c#,sql,sql-server,macos,visual-studio,C#,Sql,Sql Server,Macos,Visual Studio,当我试图打开数据库连接时,我遇到以下异常 已成功与服务器建立连接,但在预登录握手过程中发生错误。(提供商:SSL) 提供程序,错误:31-加密(ssl/tls)握手失败) 我是在mac的visual studio 2017中编写代码的 我的代码: SqlConnection con = new SqlConnection(@"Data Source=192.168.1.114;Initial Catalog=DivaLearn;Integrated Security=False;User ID=

当我试图打开数据库连接时,我遇到以下异常

已成功与服务器建立连接,但在预登录握手过程中发生错误。(提供商:SSL) 提供程序,错误:31-加密(ssl/tls)握手失败)

我是在mac的visual studio 2017中编写代码的

我的代码:

SqlConnection con = new SqlConnection(@"Data Source=192.168.1.114;Initial Catalog=DivaLearn;Integrated Security=False;User ID=sa;Password=sqlserver;Connect Timeout=15;");
con.Open();
如何从表中获取数据?
提前感谢。

这是因为.NET内核中有一个bug。升级到2.0.7,它将在Mac OSX Sierra上再次运行。请参见

这是由于.NET内核中的一个错误造成的。升级到2.0.7,它将在Mac OSX Sierra上再次运行。请参见

您使用的是哪个版本的SQL?-SQL在屏幕上说了什么matter@BugFinder我正在使用sql server 2012。在windows中,已成功建立计算机连接。我可以从表中得到数据。但是在mac中我不能。你的服务器强制SSL加密吗?您可能需要获取安装在SQL Server上的证书并将其安装在Mac(公钥)上,或者可能需要在连接字符串中添加“Encrypt=True”。这取决于服务器的设置方式。我会联系你们的DBA来确定他们做了什么。环顾四周,这实际上可能是.Net内核中的一个bug。请看这里:这里有另一个关于TLS版本的链接,他们通过重新启用TLSV1来解决这个问题。这不是一个理想的解决方案,但可能是你可以尝试的。查看我之前发布的线程,它看起来更像是驱动程序中的一个bug,因为您可以从Windows连接。您正在使用哪个版本的SQL?-SQL在屏幕上说了什么matter@BugFinder我正在使用sql server 2012。在windows中,已成功建立计算机连接。我可以从表中得到数据。但是在mac中我不能。你的服务器强制SSL加密吗?您可能需要获取安装在SQL Server上的证书并将其安装在Mac(公钥)上,或者可能需要在连接字符串中添加“Encrypt=True”。这取决于服务器的设置方式。我会联系你们的DBA来确定他们做了什么。环顾四周,这实际上可能是.Net内核中的一个bug。请看这里:这里有另一个关于TLS版本的链接,他们通过重新启用TLSV1来解决这个问题。这不是一个理想的解决方案,但可能是你可以尝试的。查看我之前发布的线程,它看起来更像是驱动程序中的一个bug,因为您可以从Windows连接。