public static SslChannel CreateChannel(Socket socket, string host) { var channel = new SslChannel(socket); channel._stream.AuthenticateAsClient(host); return channel; }
public static SslChannel CreateChannel(Socket socket, System.Security.Cryptography.X509Certificates.X509Certificate certificate) { var channel = new SslChannel(socket); channel._stream.AuthenticateAsServer(certificate); return channel; }