我有一个使用MonoTouch开发的iPhone应用程序效果很好,但今天我们的一个用户遇到了一个问题,当我的应用程序针对我们的Google App Engine服务器发出HTTP Post时,我发现了这个问题。当用户切换到WIFI时它运行良好,但是当他使用Vodafone 3G网络时,它失败了:
Error getting response stream (Write: The authentication or decryption has failed.): SendFailure - at System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Net.HttpWebRequest.GetRequestStream () [0x00000] in <filename unknown>:0
这是MonoTouch,我的代码还是沃达丰的问题?我尝试重写证书回调并返回true但它没有任何区别:
public static bool Validator (object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain,
System.Net.Security.SslPolicyErrors sslPolicyErrors)
{
return true;
}
ServicePointManager.ServerCertificateValidationCallback = Validator;
HttpPost (url, "test=true&debug=true&devregid=" + token + "&uniqueID="+UIDevice.CurrentDevice.UniqueIdentifier + "&devtype=" + Globals.GetDeviceType());