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;
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Comments are moderated, so you'll have to wait a little bit before they appear!