System.ComponentModel.Win32Exception:客户端和服务器无法通信,因为它们没有通用的算法

时间:2017-10-07 14:33:32

标签: mysql .net ssl amazon-rds mysql-connector

上个月,我将客户网站更新为标准安全网站。然而,本周没有任何问题(05/10 @大约上午10点)我开始收到详细说明如下的例外情况:

System.ComponentModel.Win32Exception: The client and server cannot communicate, because they do not possess a common algorithm

我的AWS MySQL RDS的连接字符串包括在内,因为SSLMode =必需的时间开始。

我花了一个时间试图解开其根本原因,并最终将数据库上的SSLMode设置为无。

我得出的唯一结论是网站上的SSL证书与强制我的MySQL连接SSLMode之间存在冲突。

我已将网站更新为.net 4.6。*无效....

欢迎任何想法或建议......

我正在使用:MySQL Connector,AWS MySQL 5.6,.net 4.6

内部例外:

 System.Data.Entity.Core.ProviderIncompatibleException: An error occurred accessing the database. This usually means that the connection to the database failed. Check that the connection string is correct and that the appropriate DbContext constructor is being used to specify it or find it in the application's config file. See http://go.microsoft.com/fwlink/?LinkId=386386 for information on DbContext and connections. See the inner exception for details of the failure. ---> System.Data.Entity.Core.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The client and server cannot communicate, because they do not possess a common algorithm
   --- End of inner exception stack trace ---
   at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)

1 个答案:

答案 0 :(得分:2)

请注意,我对MySQL Connector或AWS没有任何线索。说完这个,我猜了一下:

从错误消息中,我们最终可以得出结论,客户端和服务器无法就密码套件达成一致。如果您还没有听说过该主题:

SSL是一种可以使用大量不同密钥交换,加密和MAC算法的协议。 (密钥交换,加密,MAC)算法(方法)的某个元组称为密码套件。建立SSL连接时,服务器和客户端需要就某个密码套件达成一致,密码套件将用于交换密钥,加密和验证连接。

这背后的基本原理是,可以轻松地引入和使用新的,更安全的密码,而无需更改SSL规范本身,并且可以轻松删除旧的,不安全的破解密码,而无需更改SSL规范本身。

这意味着服务器的所有者可以说:"我向我的客户提供SSL,但只提供密码套件X,Y和Z"。如果客户端尝试连接,但仅支持密码套件A,B和C,则连接将失败。

现在,密码套件有时会被弃用,因为它被认为是不安全的。在这种情况下,该密码套件通常会被O / S收到的安全更新静默禁用,这可能是您可能遇到的:

当服务器更新时,可能已经禁用了一个或多个SSL密码套件,无论是对MySQL的更新,还是对O / S本身的更新或为应用程序提供加密服务的库。这可能会导致您(客户端)和服务器不再具有通用密码套件的情况。

也有可能有人通过意图禁用服务器上的某些密码套件(即手动,即不是"附带损害"安装更新)。

此外,情况可能相反:如果您已在 计算机(客户端)上安装了更新或已禁用某些密码套件,则您的客户端和服务器可能无法再连接

要确定如何调试,我们需要了解有关您的配置的更多信息。但是一个一般的提示:

在SSL握手期间,客户端向服务器发送hello,反之亦然。此hello中的客户端和服务器提供了他们支持的密码套件列表。由于客户端和服务器问候语未加密,因此您可以使用Wireshark等工具轻松嗅探它们。然后,您可以比较客户端和服务器支持的密码套件列表,并检查是否至少有一个通用密码套件。

如果没有,您可能已经发现了问题。在这种情况下,您必须在客户端或服务器端更改配置,以便客户端和服务器再次至少具有一个通用密码套件。如果您需要帮助,请回来,但请首先分析上面提出的情况。

相关问题