1

我正在尝试建立使用 Ssl3 加密的 tcp 连接。

基本上我只是在创建 TCP 连接,而不是在此之上创建 SSLStream:

var ss = new SslStream(poolItem.SecureConnection, false, remoteCertificateValidationCallback);

ss.ReadTimeout = ss.WriteTimeout = timeout;

ss.AuthenticateAsClient(host);

var pp = ss.SslProtocol;

我的问题是默认情况下 SslStream 使用 TLS。我希望它是 Ssl3。

在 HttpWebRequest 中,您可以使用以下代码更改协议:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;

我检查了它,它不会影响 SslStream。

如何将 SslStream 的协议更改为 Ssl3?

4

1 回答 1

1

您只需要使用AuthenticateAsClient允许您指定应允许哪些协议的重载:

AuthenticateAsClient
  (host, new X509CertificateCollection(), SslProtocols.Ssl3, false);
于 2014-07-10T13:49:44.840 回答