HarunBahcel / apns-sharp

Automatically exported from code.google.com/p/apns-sharp
0 stars 0 forks source link

System.Security.Cryptography.CryptographicException: The specified network password is not correct. #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
receive a "System.Security.Cryptography.CryptographicException: The specified 
network password is not correct." exception when attempting use a passwordless 
key on Windows Server 2003 (XP may also be affected) Vista, Windows 7 and 
windows Server 2008 are not affected.

Steps to reproduce:
Using Windows Server 2003, attempt to construct an instance of 
NotificationConnection with and empty string passed for the password parameter.

Fix?

use the following constructor 

public X509Certificate2(
    string fileName,
    string password,
    X509KeyStorageFlags keyStorageFlags
)

set password = string.Empty
use X509KeyStorageFlags.MachineKeySet

See attatched patched file for my working fix

Using this patch behaviour works as expected on Windows 2003, Windows 7 and 
Windows Server 2008 (Mono has not been tested).

What version of the product are you using? 
1.0.3.0
On what operating system?
Windows Server 2003 x64

Please provide any additional information below.

I fixed the problem based on the discussion here:
http://www.developmentnow.com/g/46_2006_3_0_0_727204/Strange-problem-with-X509Ce
rtificate2-on-Windows-2003.ht

Original issue reported on code.google.com by ratherfl...@gmail.com on 17 Jun 2010 at 8:28

Attachments:

GoogleCodeExporter commented 8 years ago
I'm going to accept your changes.  I haven't tested on mono yet either, but I 
don't think it should cause problems.  Worst case, the user would have to use a 
password protected keyfile (which isn't a bad idea anyways).

Original comment by jond...@gmail.com on 21 Jun 2010 at 4:04