c# - 使用 iPhone Apple 推送通知提供程序 (apns-sharp) 时出现 SslStream.AuthenticateAsClient 异常

标签 c# iphone apple-push-notifications sslstream

使用 Apple 推送通知提供程序 (apns-sharp) 时,我收到以下异常。

推送通知可以在我的开发计算机上运行,​​但无法在 Rackspace 云托管中运行。我的开发人员正在运行精确的 Rackspace Cloud 自定义介质信任配置。机器,因此中等信任不是这里的问题。另外,证书文件不可能是问题,因为它适用于我的开发人员。机器。

有什么想法吗?

更新#1:这是否与 Rackspace 云服务器上可能不存在的 Entrust 根服务器有关?我检查了 apns-sharp 代码,看起来它忽略了证书验证,但我不是 100% 确定。

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()

最佳答案

关于c# - 使用 iPhone Apple 推送通知提供程序 (apns-sharp) 时出现 SslStream.AuthenticateAsClient 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2094735/

相关文章:

c# - 使用 C# 将文本数据文件写入 Excel

c# - 如何在 ASP.NET 中返回 XML?

iphone - 如何创建像UITableViewCell这样的TextField?

iphone - 如何根据 iOS 中的当前设备为单个类加载不同的 xib?

ios - 不会为每个推送通知调用 didReceiveRemoteNotification

c# - 为 main、interface 和 class 创建一个单独的文件

c# - 按多列分组 linq count 嵌套行

iphone - NSRange : incorrect behavior. 为什么?

ios - 丰富的推送通知在 iOS 的 iPhone 11 Pro Max 中不起作用

iOS8 - 没有方法直接出现推送通知权限弹窗