title: Xamarin webview Android SSL error untrusted - how to add trusted certificate
body: <p>I have SSL error untrusted on my Xamarin application on adroid app (iOS works good). I need to use Webview.</p>
  <p>I follow this instructions for httpclient : <a href="https://thomasbandt.com/certificate-and-public-key-pinning-with-xamarin" rel="nofollow noreferrer">https://thomasbandt.com/certificate-and-public-key-pinning-with-xamarin</a> . I need to set TrustManagerFactory, KeyManagerFactory and KeyStore, but in WebViewRenderer and WebViewClient I can not find option to add my certificates as trusted. I dont want to compare certificates in OnReceivedSslError override method, because certificate that come in this method is the final certificate (that will expire up to one year). I want to add my root and intermediate certificates to list of trusted certificates before checking certificate method in webview will be called.</p>
  <p>ExportRenderer:</p>
  <pre><code>public class CustomWebView : WebViewRenderer
      {
          private TrustManagerFactory _trustManagerFactory;
          private KeyManagerFactory _keyManagerFactory;
          private KeyStore _keyStore;
  
          public CustomWebView(Context context) : base(context)
          {
          }
  
          protected override void OnElementChanged(ElementChangedEventArgs&lt;Xamarin.Forms.WebView&gt; e)
          {
              base.OnElementChanged(e);
              if (e.NewElement != null)
              {
                  var customWebViewClient = new CustomWebViewClient();
                  _trustManagerFactory = CertificateHelper.TrustManagerFactory;
                  _keyManagerFactory = CertificateHelper.KeyManagerFactory;
                  _keyStore = CertificateHelper.KeyStore;
                  Control.SetWebViewClient(customWebViewClient);
              }
          }
      }
  </code></pre>
  <p>How to set TrustManagerFactory, KeyManagerFactory and KeyStore here?</p>