对SSPI的调用失败 - 收到的消息是意外的或格式错误

时间:2017-02-27 19:12:21

标签: c# .net pushsharp

我们正在使用稍微修改过的PushSharp v2.2.1.0版本,该版本最近停止了我们最新版本的工作。由于重写的时间限制,我们无法将其更新为4.x或3.x版本。经过几天修补代码的大部分方面,我不确定还有什么可能导致这个问题。

每当我们尝试处理数据时,我们都会收到以下错误(到目前为止它看起来只在Apple方面):

A call to SSPI failed, see inner exception.
at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
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.StartReceiveBlob(Byte[] buffer, 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.StartReceiveBlob(Byte[] buffer, 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.StartReceiveBlob(Byte[] buffer, 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.StartReceiveBlob(Byte[] buffer, 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.StartReceiveBlob(Byte[] buffer, 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 PushSharp.Apple.FeedbackService.Run(ApplePushChannelSettings settings, CancellationToken cancelToken)
at PushSharp.Apple.ApplePushService.<>c__DisplayClass4.<.ctor>b__1(Object state) 

Inner Exception: System.ComponentModel.Win32Exception (0x80004005)
The message received was unexpected or badly formatted

我们已经提到了here提到的修复程序。如果没有发布大量代码,我不确定哪些信息有助于调试。我们没有收到任何问题或错误检索和加载证书(日志记录表明它已正确加载和正确的版本)。我们确实对此证书进行了最新更新,因为旧证书已过期,但新版本正在正确加载。

我们的基础架构没有任何改变,这意味着入站数据会发生变化。对安全帐户信息进行了一些屏蔽更改,但删除这些更改并未解决问题,并且只应在日志记录期间进行。我错过了什么?

1 个答案:

答案 0 :(得分:3)

因为我找到了几个接近这个问题的答案,但没有解决它(并且因为PushSharp的Git页面表明他们对2.x的问题没有兴趣)我&#39;我会把我的具体答案放在希望它可以帮助某人:

我的问题围绕着新的证书。虽然我们安装了新证书,但我们没有添加保存证书私钥的p12文件,因此无法正确加密邮件。

将p12文件安装到服务器解决了该问题。

总而言之,对于一个被推翻的问题来说,这是一个相当明显的解决方案。