微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

绕过 gridview 上不受信任的 ssl 链接

如何解决绕过 gridview 上不受信任的 ssl 链接

我有一个包含“judul”和“cover”的 JSON。 “封面”包含不受信任的 SSL,而 JSON 不包含。 代码

string certPath = @"Assets\kcssl.p12";
StorageFile file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(certPath);
IBuffer buffer = await FileIO.ReadBufferAsync(file);
string certData = CryptographicBuffer.EncodetoBase64String(buffer);
await CertificateEnrollmentManager.UserCertificateEnrollmentManager.ImportPfxDataAsync(
    certData,"Asdf123#",ExportOption.NotExportable,KeyProtectionLevel.NoConsent,InstallOptions.None,"kcssl");
var certificate = await CertificateStores.FindAllAsync(new CertificateQuery() { FriendlyName = "kcssl" });
ClientCert = certificate.Single();
HttpBaseProtocolFilter aHBPF = new HttpBaseProtocolFilter();
aHBPF.ClientCertificate = ClientCert;
HttpClient httpClient = new HttpClient(aHBPF);
Dictionary<string,string> pairs = new Dictionary<string,string>();
pairs.Add("halaman","1");
pairs.Add("limit","16");
pairs.Add("SCH-API-KEY","SCH_KEnaBiDeplebt");
var formContent = new HttpFormUrlEncodedContent(pairs);
HttpResponseMessage response = await httpClient.PostAsync(new Uri(urlPath),formContent);
httpClient.dispose();
response.EnsureSuccessstatusCode();
string jsonText = await response.Content.ReadAsstringAsync();
try
{
    JsonArray jsonData1 = jsonObject["data"].GetArray();
    foreach (JsonValue groupValue1 in jsonData1)
    {
        JsonObject groupObject2 = groupValue1.Getobject();  
        string title = groupObject2["judul"].GetString();
        string cover = groupObject2["cover"].GetString();
        Buku file1 = new Buku();
        file1.Judul = title;
        string thumb = cover.Replace("http://","https://");
        file1.Cover = thumb;
    }
    itemGridView.ItemsSource = datasource;
}

我有一个问题,无法在 gridview 上显示封面(“封面”为空白)。怎么处理?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。