gpt4 book ai didi

asp.net - 已成功与服务器建立连接,但在登录前发生错误

转载 作者:行者123 更新时间:2023-12-02 02:00:58 27 4
gpt4 key购买 nike

当我从内置服务器中的 visual studio 运行 Web 服务时,我能够运行该服务并访问数据库。

但是当我在 iis 7.5 上托管 Web 服务时,我可以运行 Web 服务但无法访问数据库。我收到以下错误。

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)

我不知道如何解决这个问题。请在这方面帮助我。

最佳答案

如果您使用 SMO,那么您可以执行以下代码:

SqlConnectionInfo sci = new SqlConnectionInfo();
sci.ConnectionProtocol = NetworkProtocol.NamedPipes;
sci.EncryptConnection = false;

//当您使用 sqlserver SMO 时,将 EncryptConnection 设置为 false,当该属性设置为 true 时,必须设置 SQL 服务器实例的服务器证书。

关于asp.net - 已成功与服务器建立连接,但在登录前发生错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17223192/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com