Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
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 said:
I've started getting push notification from localhost :) but its not working from IIS 7.
Any suggetions, what could be the reseon ??
Posted
Updated 6-May-11 4:27am
v6
Comments
Keith Barrow 5-May-11 6:09am    
Any chance of some code or stack-trace?
[no name] 5-May-11 6:20am    
I am getting error when i am doing this :
NotificationService service = new NotificationService(sandbox, p12Filename, p12FilePassword, 1);
Keith Barrow 5-May-11 6:37am    
That doesn't tell us anything other than the problem happens when creating the notification service. You could have a missing key, there could be bad config somewhere, we can't tell until you give us stacktrace or more of the related code.
Keith Barrow 5-May-11 6:38am    
Please update your question rather than replying in comments, it make the Question harder for others to read.
[no name] 5-May-11 8:26am    
Added stack trace Sir.

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.
 
Share this answer
 
I just fixed the same issue on my server setting the application pool identity (in advanced settings of the app-pool) to LocalSystem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900