X.509 Certificate Installation
- From: "JohnD" <JohnD@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 3 Jul 2005 21:17:02 -0700
Hi there
I've got an issue with installing an X.509 certificate into the Local
Machine's Personal store and to grant ASP.NET access to the private key. I'm
sure I'm just missing one step, since I've managed to do this before, but I'd
appreciate any help anyone could offer.
I've got a PFX file with the public/private key pair. I've tried installing
it in two ways:
1. Using winhttpcertcfg from the Windows Resource Kit (which is the way I
did it in the past) - the exact command line I use is winhttpcertcfg -i
certificatefile.pfx -p password -c LOCAL_MACHINE\My -a ASPNET
2. Double-clicking the PFX file, installing it into the Local Machine store
through the wizard, and then granting ASPNET all rights through WSE's X.509
certificate tool.
It seems like the certificate is installed correctly when I use either of
these methods, and the WSE classes can find the certificate quite happily but
unfortunately when I run the following code, either in ASP.NET or in Windows,
I get an exception:
[// the service is using HTTPS
X509CertificateStore store =
X509CertificateStore.LocalMachineStore(X509CertificateStore.MyStore);
store.OpenRead();
X509CertificateCollection coll = store.FindCertificateBySubjectString("C");
X509Certificate cert = coll[0]; // this finds the right certificate
service.ClientCertificates.Add(cert);
service.CallMethod();]
[The exception that is thrown from the last line (CallMethod) is:
System.Net.WebException: The underlying connection was closed: Could not
establish secure channel for SSL/TLS.]
Like I said, this is happening in a Windows Forms app running under my own
user account (which is the same account I installed the certificate under),
leading me to believe that this probably NOT related to granting permissions
to the ASPNET account, but rather is something different.
Thanks in advance!
- John
.
- Prev by Date: Signed XML
- Next by Date: [Policy("ServerPolicy")]
- Previous by thread: Signed XML
- Next by thread: [Policy("ServerPolicy")]
- Index(es):
Relevant Pages
|