使用Apple推送通知提供程序(apns-sharp)时,我收到以下异常。
推送通知适用于我的开发计算机,但它不能在Rackspace Cloud托管中运行。我有与我的开发人员一起运行的确切Rackspace Cloud自定义中等信任配置。机器所以中等信任不能成为问题。此外,证书文件不能成为我的开发人员的问题。机。
有什么想法吗?
更新#1:这是否与可能位于Rackspace Cloud服务器上的Entrust根服务器有关?我检查了apns-sharp代码,看起来它忽略了证书验证,但我不是百分百肯定。
The credentials supplied to the package were not recognized at System.Net.SSPIWrapper.AcquireCredentialsHandle(SSPIInterface SecModule, String package, CredentialUse intent, SecureCredential scc)
at System.Net.Security.SecureChannel.AcquireCredentialsHandle(CredentialUse credUsage, SecureCredential& secureCredential)
at System.Net.Security.SecureChannel.AcquireClientCredentials(Byte[]& thumbPrint)
at System.Net.Security.SecureChannel.GenerateToken(Byte[] input, Int32 offset, Int32 count, Byte[]& output)
at System.Net.Security.SecureChannel.NextMessage(Byte[] incoming, Int32 offset, Int32 count)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
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.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
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.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
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 JdSoft.Apple.Apns.Notifications.NotificationConnection.OpenSslStream()
at JdSoft.Apple.Apns.Notifications.NotificationConnection.Reconnect()
at JdSoft.Apple.Apns.Notifications.NotificationConnection.workerMethod()
答案 0 :(得分:2)
答案 1 :(得分:0)
您是否关注此页面: http://code.google.com/p/apns-sharp/wiki/HowToCreatePKCS12Certificate
此外,您可能有兴趣查看最新版本的apns-sharp。它解决了很多问题。
答案 2 :(得分:0)
在我的情况下,此问题与我无法解决的Rackspace Cloud Sites上的中型信任安全性有关。为了解决这个问题,我改变了设计,使用PHP代码访问APNS。
答案 3 :(得分:0)
对于继续获得此例外的人:
我有同样的例外,阅读'apns-sharp'中的所有程序和论坛都没有帮助。从MAC导出证书一切都很好,我的问题是,当我在本地计算机上安装证书时默认使用配置,因为 privateKey 未导入,因此无法使用该证书。 然后,当您打开新证书进行安装时,应确保安装私钥。 在代码中你应该有类似的东西:
new X509Certificate2(rawCertificateInBytes, Password, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet);
这解决了我的问题。