Windows 10 Universal App - Ignore Valdiation SSL Certificate

I am working on a universal Windows 10 application. I am trying to connect to an OAuth server with an automatically signed certificate.

When I open a web view on this server, I get an error message:

"The security certificate required to access this resource is not valid."

I wanted to use the following construct, but the ServicePointManager does not exist in the Universal App.

ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; 

Any idea how to get around ssl checking in these applications? Thanks.

+3
source share
1 answer

In Windows Runtime, web browsing should never go to an untrusted page, so you will encounter this exception.
To solve your problem, you need to include certificates in your UWP application or you need to ignore SSL certificate errors.

To include certificates in your UWP application, you need to add a Certificate declaration to your Package.appxmanifest. enter image description here
For more information, try looking at this article: http://blogs.msdn.com/b/wsdevsol/archive/2014/06/05/including-self-signed-certificates-with-your-windows-runtime-based- windows-phone-8-1-apps.aspx

Yes, ServicePointManager is not available in the Windows Runtime application, to ignore SSL certificate errors, we can use HttpBaseProtocolFilter.IgnorableServerCertificateErrors | ignorableServerCertificateErrors to help us. For more information, please try the following two articles:
http://blogs.msdn.com/b/wsdevsol/archive/2013/10/17/how-to-ignore-self-signed-certificate-errors-in-windows-store-apps-8-1.aspx .
https://bernhardelbl.wordpress.com/2013/06/28/ignore-ssl-certificate-errors-in-windows-8-1-apps/ .

+5
source

Source: https://habr.com/ru/post/1240131/


All Articles