[英]The client and server cannot communicate, because they do not possess a common algorithm, C# SslStream
Following is my Setup for mutual SSL authentication for client/server console app on Windows 10: 以下是我在Windows 10上为客户端/服务器控制台应用程序进行相互SSL身份验证的设置:
Server code: 服务器代码:
sslStream.AuthenticateAsServer(certificate, true, SslProtocols.Tls, true);
Client code: 客户代码:
sslStream.AuthenticateAsClient(hostName, certificates, SslProtocols.Tls12, true);
Error: 错误:
Exception: A call to SSPI failed, see inner exception. 例外:对SSPI的调用失败,请参阅内部异常。
Inner exception: The client and server cannot communicate, because they do not possess a common algorithm 内部异常:客户端和服务器无法通信,因为它们没有通用算法
Question: 题:
When i change the SslProtocols to be same in client and server, ie TLS 1.0, SSL handshake is successful. 当我将SslProtocols在客户端和服务器中更改为相同时,即TLS 1.0时,SSL握手成功。 Why does the handshake fail when the SSL protocol is different on client and server?
当客户端和服务器上的SSL协议不同时,为什么握手失败?
The protocols have to be the same. 协议必须相同。 You have to "negotiate" a common protocol between the server and client or they aren't able to speak the same language.
您必须“协商”服务器和客户端之间的通用协议,否则他们无法使用相同的语言。 The
SslProtocols
enum is marked as [Flags]
so that you can specify multiple protocols, eg SslProtocols.Tls | SslProtocols.Tls12
SslProtocols
枚举标记为[Flags]
以便您可以指定多个协议,例如SslProtocols.Tls | SslProtocols.Tls12
SslProtocols.Tls | SslProtocols.Tls12
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.