1

J'ai une application asp.net qui utilise les bibliothèques APNs-Sharp pour envoyer des notifications push. Il fonctionne très bien sur ma machine locale, mais quand je publierai à un ordinateur Windows 2008 machine serveur r2 je reçois l'erreur suivante:Les bibliothèques APNs-sharp ne fonctionnent pas sur 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) 

Je ne sais pas pourquoi ça devient cette erreur seulement sur la machine du serveur .. Est-ce que Quelqu'un at-il des idées sur ce que pourrait être le problème?

J'ai ajouté une vérification à mon code pour voir que le fichier de certificat peut être trouvé sur le serveur et il est. le mot de passe est correct. Donc, la seule chose que je peux penser est que cela a quelque chose à voir avec Windows Server 2008 R2.

Répondre

2

trouvé la solution. Dans la console de gestion iis, vous devez définir l'identité des pools d'applications par défaut sur le système local.

+0

Merci. Ça fonctionne. Mais pouvez-vous s'il vous plaît expliquer quel était le problème lorsque j'ai utilisé l'identité des pools d'applications? – Meet

Questions connexes