首页 新闻 会员 周边 捐助

C#开发IOS推送服务端报错

0
悬赏园豆:20 [待解决问题]

最近,在开发IOS推送的服务端的时候,在sslStream.AuthenticateAsClient(host, certificates, System.Security.Authentication.SslProtocols.Ssl3, false);代码中,报:

System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)
   at MoonAPNS.PushNotification.OpenSslStream(String host, X509CertificateCollection certificates) in E:\linxm\Sources\APNS-Test\APNS_Moon\PushNotification.cs:line 231

我试了JdSoft.Apple.Apns和MoonApns,都出现相同的错。

请问各位大侠有没有知道是什么原因,如何解决?

linxm的主页 linxm | 初学一级 | 园豆:182
提问于:2015-04-16 10:53
< >
分享
所有回答(3)
0

会不会是因为GFW。。。

XiaoFaye | 园豆:3087 (老鸟四级) | 2015-04-16 11:44

应该不会吧,如果是因为GFW而不行,那么国内的服务器岂不是都不能忘IOS上推送消息?

支持(0) 反对(0) linxm | 园豆:182 (初学一级) | 2015-04-16 11:57
0

https://github.com/Redth/PushSharp

写代码的小2B | 园豆:4377 (老鸟四级) | 2015-04-17 10:13

谢谢,我试一下!

支持(0) 反对(0) linxm | 园豆:182 (初学一级) | 2015-04-20 11:49
0

同问,前天都正常的

step | 园豆:2 (初学一级) | 2016-01-22 20:17
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册