Apple推送通知:“加密例外” [英] Apple push notification : "Cryptographic Exception"

查看:112
本文介绍了Apple推送通知:“加密例外”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在使用苹果证书进行推送通知,并且它在localhost上工作正常,但我正在考虑加密异常:当我设置项目的stratup URL时出现内部错误错误消息。



[来自评论]

当我这样做时我收到错误:

Hello everyone, I am using apple certificate for push notification and its working fine on localhost but i am geting Cryptographic Exception: An internal error occoured error message when i set the stratup URL of my project.

[from comment]
I am getting error when i am doing this :

NotificationService service = new NotificationService(sandbox, p12Filename, p12FilePassword, 1);





下面是堆栈跟踪:





Below is the stack trace :

at 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 Apple.Apns.Notifications.NotificationConnection.start(String p12File, String p12FilePassword)
at Apple.Apns.Notifications.NotificationConnection..ctor(String host, Int32 port, String p12File, String p12FilePassword)
at Apple.Apns.Notifications.NotificationService.set_Connections(Int32 value)
at Apple.Apns.Notifications.NotificationService..ctor(Boolean sandbox, String p12File, String p12FilePassword, Int32 connections)
at Main.SendNotification(String message, String testDeviceToken) in d:\test\PushNotification\App_Code\Manager.cs:line 131







prot0col说:

我开始获得推送通知来自localhost :)但它无法在IIS 7中运行。

任何建议,可能是什么问题?




prot0col said:
I've started getting push notification from localhost :) but its not working from IIS 7.
Any suggetions, what could be the reseon ??

推荐答案

你是在错误的地方提出这个问题。您应该在 Apple的开发者支持论坛 [ ^ ]。



这里的任何人都不太可能有任何图书馆的经验您正在使用。
You're asking this question in the wrong place. You should be asking in Apple's Developer Support forum[^].

It's extremely unlikely anyone here is going to have any experiense with the library you're using.


我刚刚在我的服务器上修复了相同的问题,将应用程序池标识(在应用程序池的高级设置中)设置为LocalSystem。
I just fixed the same issue on my server setting the application pool identity (in advanced settings of the app-pool) to LocalSystem.


这篇关于Apple推送通知:“加密例外”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆