Reputation: 79
I'm new to C# development.
In PHP we use
stream_socket_enable_crypto($fp, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
What is its equivalent in C#?
Upvotes: 2
Views: 1821
Reputation: 3509
SSLStream appears to do what you want
var tcp = new TcpClient(machineName,443);
var ssl = new SslStream(tcp.GetStream);
You can specify a callback for doing certification validation. Otherwise it appears to default to the system's policy ( which I believe is what I.E. also uses by default)
Upvotes: 4