I\'m trying to bypass https certificate validation only to our own testing environment (multiple machines), while trying to keep certificate validation for all the other connect
Seems like in .NET 4.5 you can do the following:
var request = (HttpWebRequest)WebRequest.Create(url);
request.ServerCertificateValidationCallback +=
(sender, certificate, chain, sslPolicyErrors) => true
I did not realize it initially, as you actually have to cast result of Create
method to HttpWebRequest
, as abstract WebRequest
does not contain this delegate.