I have seen several older posts regarding SslStream. None of them seemed to have a conclusion. Since it has been awhile since the older posts I am looking for an update. I have created the socket and endpoint. Opened the connection and attempted authentication. I cannot get the authenticateasclient function to work. The authentication keeps failing. The server cert is the same name as the host. Any other ideas? Or does the gadget even support this?
TcpClient client = listener.AcceptTcpClient();
SslStream sslStream = new SslStream(client.GetStream(), false, RemoteCertificateValidationCB);
sslStream.AuthenticateAsServer(ServerCertificate, false, SslProtocols.Default, true);
Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Parse(“xx.xx.xx.xx”), xxxx);
SslStream sslStream = new SslStream(client);
sslStream.AuthenticateAsClient(TCPserver, null, SslVerification.CertificateRequired, SslProtocols.Default);