简体   繁体   English

客户端和服务器无法通信,因为它们没有通用的算法C#SslStream

[英]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身份验证的设置:

  1. There is a server listener console app that only accepts TLS 1.0 connections. 有一个服务器监听器控制台应用程序只接受TLS 1.0连接。
  2. Client console application uses SslStream.AuthenticateAsClient to configure a secure connection and uses TLS 1.2 connection. 客户端控制台应用程序使用SslStream.AuthenticateAsClient配置安全连接并使用TLS 1.2连接。
  3. I am using the following example for mutual SSL authentication: http://www.codeproject.com/Articles/326574/An-Introduction-to-Mutual-SSL-Authentication 我使用以下示例进行相互SSL身份验证: http//www.codeproject.com/Articles/326574/An-Introduction-to-Mutual-SSL-Authentication

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.

相关问题 SSLStream.AuthenticateAsServer “客户端和服务器无法通信,因为它们没有通用算法” - SSLStream.AuthenticateAsServer “The client and server cannot communicate, because they do not possess a common algorithm” C# 客户端和服务器无法通信,因为它们没有通用的算法 - C# The client and server cannot communicate, because they do not possess a common algorithm 客户端和服务器无法通信,因为它们没有通用的 WCF 算法 - The client and server cannot communicate, because they do not possess a common algorithm WCF 客户端和服务器无法通信,因为它们在Windows Server 2008 Web上不具有通用算法 - The client and server cannot communicate, because they do not possess a common algorithm on Windows Server 2008 Web TLS 1. 2 客户端和服务器无法通信,因为它们没有通用算法 - TLS 1. 2 The client and server cannot communicate, because they do not possess a common algorithm SoapHttpClientProtocol和TLS 1.2 - 客户端和服务器无法通信,因为它们没有通用的算法 - SoapHttpClientProtocol and TLS 1.2 - The client and server cannot communicate, because they do not possess a common algorithm ASP.NET 4.5客户端和服务器无法通信,因为它们不具有通用算法 - ASP.NET 4.5 The client and server cannot communicate, because they do not possess a common algorithm 客户端和服务器无法通信,因为它们没有共同的算法 - ASP.NET C# IIS TLS 1.0 / 1.1 / 1.2 - Win32 - The client and server cannot communicate, because they do not possess a common algorithm - ASP.NET C# IIS TLS 1.0 / 1.1 / 1.2 - Win32Exception 无法创建SSL / TLS安全通道。客户端和服务器无法通信,因为它们没有通用算法 - Could not create SSL/TLS secure channel. The client and server cannot communicate, because they do not possess a common algorithm HTTP Web 请求 TLS 1.3 C# .NET 核心 3.1 异常“客户端和服务器无法通信,因为它们不具备通用算法。” - HTTP Web Request TLS 1.3 with C# .NET Core 3.1 exception "The client and server cannot communicate, because they do not possess a common algorithm."
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM