1

我有一个使用APNs-Sharp库发送推送通知的asp.net应用程序。它工作正常,我的本地机器上,但是当我发布到Windows 2008 R2服务器的机器,我得到以下错误:APNs尖锐的库不能在Windows Server 2008上工作,CryptographicException

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有关。

回答

2

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

+0

谢谢。这是工作。但是,请您解释一下使用Application pool标识时出现的问题吗? – Meet 2015-01-14 07:34:05