Skip to content

Commit

Permalink
Merge pull request Redth#37 from tomwaters/master
Browse files Browse the repository at this point in the history
Changed p12Password parameter to allow nulls
  • Loading branch information
Redth committed Mar 14, 2012
2 parents 6f4264a + 719ca2c commit e5155b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions JdSoft.Apple.Apns.Feedback/FeedbackService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public FeedbackService(string host, int port, byte[] p12FileBytes)
// 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, "", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
certificate = new X509Certificate2(p12FileBytes, null, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
ConnectAttempts = 3;
ReconnectDelay = 10000;
}
Expand Down Expand Up @@ -126,7 +126,7 @@ public FeedbackService(string host, int port, byte[] p12FileBytes, string p12Fil
// 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);
certificate = new X509Certificate2(p12FileBytes, p12FilePassword, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
P12FilePassword = p12FilePassword;
ConnectAttempts = 3;
ReconnectDelay = 10000;
Expand Down Expand Up @@ -160,7 +160,7 @@ public FeedbackService(bool sandbox, byte[] p12FileBytes)
// 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, "", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
certificate = new X509Certificate2(p12FileBytes, null, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
ConnectAttempts = 3;
}

Expand Down Expand Up @@ -196,7 +196,7 @@ public FeedbackService(bool sandbox, byte[] p12FileBytes, string p12FilePassword
// 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);
certificate = new X509Certificate2(p12FileBytes, p12FilePassword, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
P12FilePassword = p12FilePassword;
ConnectAttempts = 3;
ReconnectDelay = 10000;
Expand Down Expand Up @@ -231,7 +231,7 @@ public void Run()
// 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(System.IO.File.ReadAllBytes(P12File), P12FilePassword ?? "", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
certificate = new X509Certificate2(System.IO.File.ReadAllBytes(P12File), P12FilePassword, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
}

certificates = new X509CertificateCollection();
Expand Down
2 changes: 1 addition & 1 deletion JdSoft.Apple.Apns.Notifications/NotificationChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public NotificationChannel(string host, int port, byte[] p12FileBytes, string p1
// 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);
certificate = new X509Certificate2(p12FileBytes, p12FilePassword, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);

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

0 comments on commit e5155b2

Please sign in to comment.