IOS推送消息程序从2014-04-16开始连接不上APNS服务器gateway.sandbox.push.apple.com IOS推送消息程序从2014-04-16开始连接不上APNS服务器gateway.sandbox.push.apple.com,报错信息为“从传输流收到意外的 EOF 或 0 个字节”,请问谁能知道具体是什么原因?十分感谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 解决了吗? 我也是那天出现了这个问题, 用的是APNS-Sharp的库,请问有解决方案了吗? 试一下SSL发送一下,好像我这边也不行,但是SSL是可以的!static void Main(string[] args) { //测试 string hostIP = "gateway.sandbox.push.apple.com";// //正式 //string hostIP = "gateway.push.apple.com"; int port = 2195; string password = "123456";// string certificatepath = "aps_development.p12"; //string certificatepath = "aps_production.p12"; //这里面证书路径一定要注意了 string p12Filename = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory + @"App_Code/", certificatepath); certificate = new X509Certificate2(System.IO.File.ReadAllBytes(p12Filename), password, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable); certificates = new X509CertificateCollection(); certificates.Add(certificate); TcpClient apnsClient = new TcpClient(); apnsClient.Connect(hostIP, port); SslStream apnsStream = new SslStream(apnsClient.GetStream(), false, new RemoteCertificateValidationCallback(validateServerCertificate), new LocalCertificateSelectionCallback(selectLocalCertificate)); try { //SSL可以换不同的试试 apnsStream.AuthenticateAsClient(hostIP, certificates, System.Security.Authentication.SslProtocols.Default, false); } catch (System.Security.Authentication.AuthenticationException ex) { Console.WriteLine("error:" + ex.Message); } if (!apnsStream.IsMutuallyAuthenticated) { Console.WriteLine("error:" + "Ssl Stream Failed to Authenticate"); } if (!apnsStream.CanWrite) { Console.WriteLine("error:" + "Ssl Stream is not Writable"); } Byte[] message = ToBytes(); try { apnsStream.Write(message); } catch (Exception ex) { throw ex; } apnsStream.Close(); Console.WriteLine("success:" + "Ssl Stream is Writable" + ",message is " + Convert.ToBase64String(message)); Console.ReadLine(); } 我也发现这个问题,但之后看了上面的代码//apnsStream.AuthenticateAsClient(hostIP, certificates, System.Security.Authentication.SslProtocols.Default, false);SslProtocols.Default,用这个测试可以 APPLE技术支持回邮件了,没有一点指导意义。就是让去以下是文档关于推送信息的一些常见难题的解决方案文档<Troubleshooting Push Notifications>:https://developer.apple.com/library/ios/technotes/tn2265/_index.html跪求各位兄弟,有无找到解决的方案,问题都出现一周了,很闹心呀 下载profile在装下 apnsStream.AuthenticateAsClient(hostIP, certificates, System.Security.Authentication.SslProtocols.Default, false);修改了以上的地方,问题还是存在 我用的是JdSoft.Apns.Notifications也是差不多16号开始发送不出去,用的测试的证书,现在还没有找到解决方案有已经解决的麻烦在这里共享下,谢谢您了! 跟换成https有没有关系呢 我也遇到这个问题,搞了两天,终于在这个帖子得到解决。证书没问题,不知道苹果做了什么改动。我是把 System.Security.Authentication.SslProtocols.Ssl3 改为 System.Security.Authentication.SslProtocols.Default 就可以了。很奇怪,具体原因未明。 针对移动应用的第三方控件技术上是否可行? GCC可以编译OC语言么? 关于iOS 加密解密的问题, 关于ios上的来电显示软件的开发 http操作需要多线程来实现么 [转]苹果的Iphone开发策略 【分享】Cocos2dx工具之Cocostudio界面编辑器二 关于xcode5启动模拟器报错的问题 NSURLSession下载中强制退出,再次进入收到上次Task的失败结果 iOS 相册选取视频遇到问题 UIPageViewController页面加个按钮,如何点击后进入下一页,上一页 我做的程序,大家帮赞点人气啊
{
//测试
string hostIP = "gateway.sandbox.push.apple.com";//
//正式
//string hostIP = "gateway.push.apple.com";
int port = 2195;
string password = "123456";//
string certificatepath = "aps_development.p12";
//string certificatepath = "aps_production.p12";
//这里面证书路径一定要注意了
string p12Filename = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory + @"App_Code/", certificatepath);
certificate = new X509Certificate2(System.IO.File.ReadAllBytes(p12Filename), password, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable); certificates = new X509CertificateCollection();
certificates.Add(certificate);
TcpClient apnsClient = new TcpClient();
apnsClient.Connect(hostIP, port); SslStream apnsStream = new SslStream(apnsClient.GetStream(), false, new RemoteCertificateValidationCallback(validateServerCertificate), new LocalCertificateSelectionCallback(selectLocalCertificate)); try
{
//SSL可以换不同的试试
apnsStream.AuthenticateAsClient(hostIP, certificates, System.Security.Authentication.SslProtocols.Default, false);
}
catch (System.Security.Authentication.AuthenticationException ex)
{
Console.WriteLine("error:" + ex.Message);
} if (!apnsStream.IsMutuallyAuthenticated)
{
Console.WriteLine("error:" + "Ssl Stream Failed to Authenticate");
} if (!apnsStream.CanWrite)
{
Console.WriteLine("error:" + "Ssl Stream is not Writable");
}
Byte[] message = ToBytes();
try
{
apnsStream.Write(message);
}
catch (Exception ex)
{
throw ex;
}
apnsStream.Close();
Console.WriteLine("success:" + "Ssl Stream is Writable" + ",message is " + Convert.ToBase64String(message));
Console.ReadLine();
}
//
apnsStream.AuthenticateAsClient(hostIP, certificates, System.Security.Authentication.SslProtocols.Default, false);SslProtocols.Default,用这个测试可以
https://developer.apple.com/library/ios/technotes/tn2265/_index.html跪求各位兄弟,有无找到解决的方案,问题都出现一周了,很闹心呀