![](/img/trans.png)
[英]SSLStream.AuthenticateAsServer “The client and server cannot communicate, because they do not possess a common algorithm”
[英]The client and server cannot communicate, because they do not possess a common algorithm, C# SslStream
以下是我在Windows 10上為客戶端/服務器控制台應用程序進行相互SSL身份驗證的設置:
服務器代碼:
sslStream.AuthenticateAsServer(certificate, true, SslProtocols.Tls, true);
客戶代碼:
sslStream.AuthenticateAsClient(hostName, certificates, SslProtocols.Tls12, true);
錯誤:
例外:對SSPI的調用失敗,請參閱內部異常。
內部異常:客戶端和服務器無法通信,因為它們沒有通用算法
題:
當我將SslProtocols在客戶端和服務器中更改為相同時,即TLS 1.0時,SSL握手成功。 當客戶端和服務器上的SSL協議不同時,為什么握手失敗?
協議必須相同。 您必須“協商”服務器和客戶端之間的通用協議,否則他們無法使用相同的語言。 SslProtocols
枚舉標記為[Flags]
以便您可以指定多個協議,例如SslProtocols.Tls | SslProtocols.Tls12
SslProtocols.Tls | SslProtocols.Tls12
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.