在登录前握手期间发生错误 [英] An error occured during the pre-login handshake

查看:1096
本文介绍了在登录前握手期间发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的使用LINQ到SQL数据库通信的C#应用​​程序,并工作得很好,当我最后一次在一个月前进行了测试。然而,它现在抛出以下异常:

I had a C# application that communicates with a database using Linq to SQL and was working just fine when I last tested it a month ago. However, it is now throwing the following exception:

A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll
------ Exception ------
Error:  A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The received certificate has expired.)



我数字签名使用Verisign键的代码,但它没有过期。我没有数字签名,直到我生成安装程序,而这是发生在调试我开发的系统,所以代码尚未签署。

I am digitally signing the code with a Verisign key, but it has not expired. I don't digitally sign until I build the installer, and this is occurring on my dev system in debug, so the code had not been signed.

这也是发生在那里的软件签名并安装其他系统。这些系统访问相同的测试数据库,因为我我的开发系统上使用,和以前的工作。

It is also happening on other systems where the software was signed and installed. These systems access the same test database as I use on my dev system, and were working previously.

的导致该错误代码行如下:

The line of code that causes the error follows:

        List<req> results = new List<req>();

        using (var db = new MyDbDataContext(connectionString))
        {
            var query =
                from item in db.reqs
                where item.senddate == null
                select item;

            results = query.ToList();
        }

的错误,当我打电话的结果=查询情况。 。了ToList();

我用下面的连接字符串:

I use the following connection string:

Data Source=<removed>;Initial Catalog=<removed>;UID=sa;PWD=<removed>;Encrypt=true;Integrated Security=false

我能如果我设置加密= false来连接,但是这不是一个可行的解决方案。

I am able to connect if I set Encrypt=false, but that is not a viable solution.

同样,这工作就好了我几个星期前测试了它的最后一次。任何见解,以什么可能发生,将不胜感激。

Again, this worked just fine the last time I tested it a couple weeks ago. Any insights as to what might be happening would be greatly appreciated.

推荐答案

我设法找到一个解决方案的post

I managed to find a solution from this post.

基本上,我加入 TrustServerCertificate = TRUE 我的连接文本,一切又开始工作。我不知道为什么它停止在首位的工作,如果有人知道,如果这将是一个永久的解决办法还是不行,我很想更多地了解发生了什么。

Basically, I added TrustServerCertificate=True to my connection text, and everything started working again. I'm not sure why it stopped working in the first place, and if anyone knows if this will be a permanent solution or not, I would love to find out more about what happened.

感谢您Carson63000和Jacco您的建议。

Thank you to Carson63000 and Jacco for the suggestions.

这篇关于在登录前握手期间发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆