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

The Certificate for this server is invalid, How to use https in xamarin forms

$
0
0

I am having an issue when communicating with back-end web server with https. It works fine with HTTP. My
app consumed WCF web service and hosted on IIS. I've used HttpClient in code.
My server has a self-signed certificate. I have made the below changes to my source code.

  1. Updated the infor.plist as given below.
    NSAppTransportSecurity
    NSAllowsArbitraryLoads
    NSExceptionDomains
    ip address without port number
    NSExceptionMinimumTLSVersion
    TLSv1.0NSExceptionRequiresForwardSecrecy
    NSExceptionAllowsInsecureHTTPLoads
    NSIncludesSubdomains

  2. Added below code to appdelegate class in iOS project
    ServicePointManager
    .ServerCertificateValidationCallback += (sender, cert, chain,
    sslPolicyErrors) => true;

I also get an error message "Your connection is not private" when the API is browsed. I can continue with an error. but I can not access the resource (backend data) through web service, does not give me any result. it works fine with HTTP.
Does anyone know how to use HTTP client with https in cross-platform development? What are alternative methods to use https? How can I ignore the SSL error?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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