1

I'm trying to establish tcp connection which is encrypted using Ssl3.

Basically I'm just creating TCP connection and than I'm creating SSLStream on top of that:

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

ss.ReadTimeout = ss.WriteTimeout = timeout;

ss.AuthenticateAsClient(host);

var pp = ss.SslProtocol;

My problem is that by default SslStream uses TLS. I want for it to be Ssl3.

In HttpWebRequest, you can use following code to change the protocol:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;

I checked it, and it doesn't affect SslStream.

How do I change SslStream's protocol to Ssl3?

Arsen Zahray
  • 24,367
  • 48
  • 131
  • 224
  • 2
    Perhaps you could start by using the `AuthenticateAsClient` overload that allows you to specify the enabled SSL protocols? – Luaan Jul 10 '14 at 12:48
  • hehe. yeah. I just went through the code and found that myself ((. just post that as an answer and I'll award it – Arsen Zahray Jul 10 '14 at 12:59

1 Answers1

1

You just have to use the AuthenticateAsClient overload that lets you specify which protocols should be allowed:

AuthenticateAsClient
  (host, new X509CertificateCollection(), SslProtocols.Ssl3, false);
Luaan
  • 62,244
  • 7
  • 97
  • 116