I have the following code, which results in a WebException and I can't figure out why for the life of me. VS2012 / .Net 4.5 RTM on Windows 8 RTM.
ServicePointManager.CertificatePolicy = null;
ServicePointManager.CheckCertificateRevocationList = false;
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
var request = WebRequest.Create(url) as HttpWebRequest;
request.ServerCertificateValidationCallback = delegate { return true; };
var response = request.GetResponse();
WebException was unhandled
The request was aborted: Could not create SSL/TLS secure channel.
I originally had the callback as its own method, which was never called. Any ideas why I am unable to ignore SSL validation errors and send all my sensitive data to an unknown web server?
ServicePointManager. ServerCertificateValidationCallback is a function, that is used to validate a server certificate. Our application uses custom validation by the client.
Right click your application name in Web Site. Select "Properties---Directory Security---Secure Communications---Edit----Cient Certificates---Ignore client certificates"
An SSL certificate is a digital certificate that authenticates a website's identity and enables an encrypted connection. SSL stands for Secure Sockets Layer, a security protocol that creates an encrypted link between a web server and a web browser.
Microsoft wont allow it. It damages the platform, because it is the reason why we arent developing apps for it. (we have millions of happy customers)
http://social.msdn.microsoft.com/Forums/windowsapps/en-US/f5821194-4c40-48e7-976c-3dec8864ac59/servicepointmanagerservercertificatevalidationcallback?forum=winappswithcsharp
You need a valid certificate or a real workaround. It is a big drawback for security reason.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With