How to ignore certificate errors in Windows Phone 7?

僤鯓⒐⒋嵵緔 提交于 2019-12-10 10:54:25

问题


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?


回答1:


No, unfortunately, the security guys won't let you.




回答2:


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.



来源:https://stackoverflow.com/questions/5648506/how-to-ignore-certificate-errors-in-windows-phone-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!