title: Using https connection for source image in Xamarin forms
body: <p>I'm developing an app using Xamarin Forms (4.5.0.356).</p>
  
  <p>I have to show an image which come from an HTTPS links using the default bind:</p>
  
  <pre><code>&lt;Image Source="{Binding PhotoURL}" /&gt; 
  </code></pre>
  
  <p>At runtime I have the error:</p>
  
  <pre><code>javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
      at com.android.org.conscrypt.ConscryptFileDescriptorSocket.startHandshake(ConscryptFileDescriptorSocket.java:219)
      at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:192)
      at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:149)
      at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:112)
      at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184)
      at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
      at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
      at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
      at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
      at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:461)
      at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
      at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.connect(DelegatingHttpsURLConnection.java:89)
      at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.connect(Unknown Source:0)
  </code></pre>
  
  <p>I know the error is caused by a self signed certificate, and I usually manage this type of error with a <em>HttpClientHandler</em> like the following:</p>
  
  <pre><code>var handler = new HttpClientHandler()
              {
                  ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) =&gt;
                  {
                      //bypass
                      return true;
                  },
              };
  _httpClient = new HttpClient(handler) { BaseAddress = new Uri(Constants.HTTP_BASE_ADDRESS) };
  </code></pre>
  
  <p>But how can I do the <em>Xamarin.Android.Net.AndroidClientHandler</em> manages self-signed certificates when the bind mechanism assigns an https source to an image control?</p>
  
  <p>Thanks</p>