【问题标题】:How to ignore certificate errors in Windows Phone 7?如何忽略 Windows Phone 7 中的证书错误?
【发布时间】:2011-04-13 11:34:57
【问题描述】:

我已经搜索了互联网,我知道在.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 网站。所以我想知道是否可以忽略认证错误,以便我可以继续我的程序?

【问题讨论】:

    标签: windows-phone-7 certificate webclient


    【解决方案1】:

    不,很遗憾,安全人员不会让你这样做。

    【讨论】:

    • 谢谢。我终于改用 HTTP 网站了。
    【解决方案2】:

    只需连接到相同的网址,但没有 https

    例子:

    改变这个 https://qa.server.com/webservices/test

    到这个 http://qa.server.com/webservices/test

    它会起作用的;)

    这只是假设你调用的服务器不需要 https。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-12-09
      • 2019-09-05
      • 2014-06-08
      • 1970-01-01
      • 1970-01-01
      • 2019-11-05
      • 1970-01-01
      相关资源
      最近更新 更多