Windows 10通用应用程序 - 忽略SSL证书限制 [英] Windows 10 Universal App - Ignore SSL Certificate Valdiation

查看:1534
本文介绍了Windows 10通用应用程序 - 忽略SSL证书限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用手机Windows 10通用应用程式。我尝试使用自动签名的证书连接到OAuth服务器。

I am working on a phone Windows 10 Universal Application. I am trying to connect to an OAuth server with auto-signed certificate.

当我打开该服务器的网络视图时,会出现错误:

When I open a web view to that server I get the error :


访问此资源所需的安全证书无效

"Security certificate required to access this resource is invalid"

我想使用以下指令,但 ServicePointManager 在通用应用程序中不存在。

I wanted to use the following intstruction but ServicePointManager does not exist on Universal App.

ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

有什么想法如何绕过对这些应用程序的SSL验证?感谢。

Any idea how to bypass ssl validation on these apps ? Thanks.

推荐答案

在Windows Runtime中,webview不应该访问不受信任的页面,因此您将遇到上述异常。 br>
为了解决您的问题,您需要在您的UWP应用程序包括证书或您必须忽略SSL证书错误。

In Windows Runtime the webview should not ever go to an untrusted page, so you will meet the above exception.
In order to solve your problem, you need to include the Certificates on your UWP app or you have to Ignore SSL Certificate errors.

如何在UWP应用程序中包含证书,您需要在Package.appxmanifest中添加证书声明。


有关详细信息,请尝试参考本文:
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

For how to include the Certificates on your UWP app, you need to add the "Certificate" Declaration to your Package.appxmanifest.
For more information, please try to refer to 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

是, ServicePointManager 在Windows Runtime应用程序中不可用,为了忽略SSL证书错误,我们可以使用 HttpBaseProtocolFilter.IgnorableServerCertificateErrors | ignorableServerCertificateErrors 属性来帮助我们。
有关详细信息,请尝试参考以下两篇文章:

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 /

Yes, ServicePointManager is not available in the Windows Runtime app, in order to ignore SSL Certificate errors, we can use the HttpBaseProtocolFilter.IgnorableServerCertificateErrors | ignorableServerCertificateErrors property to help us. For more information, please try to refer to 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/.

这篇关于Windows 10通用应用程序 - 忽略SSL证书限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆