如何忽略 Windows Phone 7 中的证书错误?
我在网上搜索过,我知道在.Net中我们可以使用以下代码来忽略认证错误。
ServicePointManager.ServerCertificateValidationCallback =
new RemoteCertificateValidationCallback(
delegate
{ return true; }
);
但 Windows Phone 7 开发不支持认证类(从 http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/thread/4f795a8e-de05-4f01-be7f-0cf2be3a71c2)。我现在使用 WebClient
访问需要首先进行认证的 HTTPS
网站。所以我想知道是否可以忽略认证错误以便我可以继续我的程序?
I have searched the internet and I know that in .Net we can use the following codes to ignore certification errors.
ServicePointManager.ServerCertificateValidationCallback =
new RemoteCertificateValidationCallback(
delegate
{ return true; }
);
But the certification classes are not supported in windows phone 7 development (know from http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/thread/4f795a8e-de05-4f01-be7f-0cf2be3a71c2). I am now using a WebClient
to visit a HTTPS
website which requires a certification first. So I am wondering is it possible to ignore the certification errors so that I can continue with my program?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,不幸的是,保安人员不会让你这么做。
No, unfortunately, the security guys won't let you.
只需连接到相同的 url,但不带 https
示例:
更改此设置
https://qa.server.com/webservices/test
到此
http://qa.server.com/webservices/test
它将起作用;)
这是仅假设您调用的服务器不需要 https。
Just make the connection to the same url but without the https
Example:
change this
https://qa.server.com/webservices/test
to this
http://qa.server.com/webservices/test
and it will work ;)
This is only assuming that the server you are calling does not require https.