How to ignore certificate errors in Windows Phone

2019-05-23 17:00发布

问题:

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.