Skip to content

Commit

Permalink
Merge pull request Redth#14 from Danielgindi/patch-2
Browse files Browse the repository at this point in the history
Edited JdSoft.Apple.Apns.Notifications/NotificationChannel.cs via GitHub
  • Loading branch information
Redth committed Oct 7, 2011
2 parents 29dd515 + ecf39c0 commit 508d2b4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions JdSoft.Apple.Apns.Notifications/NotificationChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,11 @@ public NotificationChannel(string host, int port, byte[] p12FileBytes, string p1
ConnectRetries = 6;

//Need to load the private key seperately from apple
if (string.IsNullOrEmpty(p12FilePassword))
certificate = new X509Certificate2(p12FileBytes);
else
certificate = new X509Certificate2(p12FileBytes, p12FilePassword);
// Fixed by [email protected] :
// The default is UserKeySet, which has caused internal encryption errors,
// Because of lack of permissions on most hosting services.
// So MachineKeySet should be used instead.
certificate = new X509Certificate2(p12FileBytes, p12FilePassword ?? "", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);

certificates = new X509CertificateCollection();
certificates.Add(certificate);
Expand Down

0 comments on commit 508d2b4

Please sign in to comment.