tags:

views:

60

answers:

1

Hi,

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

My question is, how to accept any ssl certification when connecting?

Thanks,

+1  A: 
public static bool RemoteCertificateValidationCallback(object sender, 

                                                    X509Certificate certificate, 

                                                    X509Chain chain, 

                                                    SslPolicyErrors errors)

{
    return true;
}
bignum
Thanks, that worked out.
Mark
No problem. Please note it isn't a good idea to do this if you need to trust the remote server. For example, if you were sending something confidential to it.
bignum
Sure, agreed. I just need it on a testing environment.
Mark