The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
[UWP]Ignore SSL Certificate Webview RRS feed

  • Question

  • Hi. I'm having issues with webview ignoring SSL sites on my staging server.  I've already added the filters but I'm still unable to ignore the SSL certificate.  Is there something I could be missing here?  The error message I kept receiving is "CertificateIsInvalid"

    private void browseSite(){
    
    
       var filter = new Windows.Web.Http.Filters.HttpBaseProtocolFilter();
                filter.IgnorableServerCertificateErrors.Add(Windows.Security.Cryptography.Certificates.ChainValidationResult.Expired);
                filter.IgnorableServerCertificateErrors.Add(Windows.Security.Cryptography.Certificates.ChainValidationResult.Untrusted);
                filter.IgnorableServerCertificateErrors.Add(Windows.Security.Cryptography.Certificates.ChainValidationResult.InvalidName);
         
    
    
                using (var client = new Windows.Web.Http.HttpClient(filter))
                {
                    try { 
                    uri = new Uri("https://ssl site/");
    
    
                    HttpRequestMessage aTempReq = new HttpRequestMessage(HttpMethod.Get, uri);
                    HttpResponseMessage aResp2 = await client.SendRequestAsync(aTempReq);
                        aResp2.EnsureSuccessStatusCode();
                         Web.Navigate(uri);
    
    
                    }
                    catch (Exception ex)
                    {
                        Debug.WriteLine("String ex : " + ex.ToString());
                    }
    
    
                }
    
    }
    

    Thursday, January 21, 2016 11:10 AM

Answers

All replies