最近,在开发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,都出现相同的错。
请问各位大侠有没有知道是什么原因,如何解决?
会不会是因为GFW。。。
应该不会吧,如果是因为GFW而不行,那么国内的服务器岂不是都不能忘IOS上推送消息?
https://github.com/Redth/PushSharp
谢谢,我试一下!
同问,前天都正常的