Accept any certificate for SSL

I have a small TcpClient application to connect to a server using SSL (SSlStream class)

My question is how to accept any ssl certificate when connecting?

Thanks,

+4
source share
1 answer
public static bool RemoteCertificateValidationCallback(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) { return true; } 
+3
source

Source: https://habr.com/ru/post/1308350/


All Articles