
apns-sharp - issue #36
System.Security.Cryptography.CryptographicException: The specified network password is not correct.
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-X509Certificate2-on-Windows-2003.ht
- NotificationConnection.cs 16.09KB
Comment #1
Posted on Jun 21, 2010 by Happy LionI'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).
Status: Fixed
Labels:
Type-Defect
Priority-Medium