1

我有一个使用APNs-Sharp库发送推送通知的 asp.net 应用程序。它在我的本地机器上运行良好,但是当我发布到 Windows 2008 r2 服务器机器时,我收到以下错误:

System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)
   at System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromBlob(Byte[] rawData, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx)
   at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromBlob(Byte[] rawData, Object password, X509KeyStorageFlags keyStorageFlags)
   at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData, String password)
   at JdSoft.Apple.Apns.Notifications.NotificationConnection.start(String p12File, String p12FilePassword)
   at JdSoft.Apple.Apns.Notifications.NotificationService.set_Connections(Int32 value)
   at JdSoft.Apple.Apns.Notifications.NotificationService..ctor(Boolean sandbox, String p12File, String p12FilePassword, Int32 connections)

我不确定为什么它只在服务器机器上出现此错误。有没有人对问题可能有任何想法?

我在我的代码中添加了一个检查,以查看证书文件是否可以在服务器上找到,并且确实如此。密码正确。所以我唯一能想到的就是它与windows server 2008 r2有关。

4

1 回答 1

2

找到了解决方案。在 iis 管理控制台中,您必须将默认应用程序池标识设置为本地系统。

于 2011-06-09T03:52:07.937 回答