Display image using https url

I need to display an image in an application. I am using the code below for this.

<Ellipse Height="60" Width="60" >
  <Ellipse.Fill>
     <ImageBrush ImageSource="{Binding ImageUrl}"/>
  </Ellipse.Fill>
</Ellipse>

Here ImageUrl is a string url.

My problem is that the url starts with https: // , and the server used the signed certificate itself , I can’t see the rendering of images with http: // working fine.

Note : its not HttpClient, so the filter cannot be here.

Any suggestion to override ssl in this case? Thanks

UPDATE 1: I added the certificate to the application using this code:

System.Uri certificateFile = new System.Uri("ms-appx:///Assets/temp.cer");
Windows.Storage.StorageFile file = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(certificateFile);
Windows.Storage.Streams.IBuffer certBlob = await Windows.Storage.FileIO.ReadBufferAsync(file);

// Create an instance of the Certificate class using the retrieved certificate blob contents
Windows.Security.Cryptography.Certificates.Certificate rootCert = new Windows.Security.Cryptography.Certificates.Certificate(certBlob);

// Get access to the TrustedRootCertificationAuthorities for your own app (not the system one)
Windows.Security.Cryptography.Certificates.CertificateStore trustedStore = Windows.Security.Cryptography.Certificates.CertificateStores.TrustedRootCertificationAuthorities;

// Add the certificate to the TrustedRootCertificationAuthorities store for your app
trustedStore.Add(rootCert);

Although the certificate was added after debugging, I can’t access https: // url. I set the build action for "Content", Thanks

+4

All Articles