Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

App Transport Security (ATS) - The certificate for this server is invalid.

$
0
0

Hi all,

Understand that for new Xamarin.iOS apps, we should use HTTPS exclusively when communicating with internet resources. When I try to debug my app in simulator, first exception hit is System.Exception: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection. I have change my plist file to enable http request by adding key NSAppTransportSecurity and set NSAllowsArbitraryLoads to true. It works for http request now.

However there is third party services request in my Apps that is self signed certificate. Now I hitting another exception ->System.Exception: The certificate for this server is invalid. I have added the code below to remove server certificate validation but not works.
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, errors) => true;

Any idea how to get rid of this exception for debug purposes?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>