Creating a Xamarin forms app that requires access to self signed websites.
The only way to accomplish this that I know of is to create custom web view renderers for each platform.
On Android, this can be accomplished by overriding OnReceivedSslError in the WebViewClient.
The question is how can we achieve this on iOS?
I have tried overriding NSUrlRequest as such:
public class MyUrlRequest : NSUrlRequest
{
public MyUrlRequest(NSUrl url) : base(url)
{
}
public MyUrlRequest(IntPtr p) : base(p)
{
}
[Export("allowsAnyHTTPSCertificateForHost:")]
public static bool Allow(string host)
{
return true;
}
}
And calling the custom request using LoadRequest, but still does not seem to work.