I'm working on a Windows app at the moment and part of the job involves comms with a Rest api over https. During the development phase the SSL certs for the server aren't valid, and this causes GetAsync for the HttpClient to return a Taskstatus.Faulted, and the whole thing breaks. To overcome this you just need this line of code:
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
Friday, 13 January 2017
Subscribe to:
Posts (Atom)