Midtown Computer Systems Enterprise

Convenient web based access to our favorite computer related Usenet groups.
MCSE.MS is not affiliated with Microsoft corporation, Cisco corporation, Oracle, CompTIA or any other vendor.
Check our Computer Hardware forum | Cell Phones reviews

Go Back  MCSE > Microsoft software reviews > Dot Net tutorials > .NET Security
This is Interesting: Free Computer Magazines Now Free shipping to

.NET Security microsoft.public.dotnet.security

 
 
Thread Tools Display Modes
  #1  
Old 03-28-04, 10:19 AM
Hari
HttpWebRequest and SSL client certs in the 'Local Computer' store
Hi,

I am using the .NET faremework 1.1 (v1.1.4322). I have a web service client that does not use WSE 2.0 but uses HttpWebRequest directly. The web service itself requires SSL client auth.

Setup:
STEP 1: I imported the SSL server cert into the 'Trusted Rooot CAs' store of the Local Computer (thru the mmc).
STEP 2: I imported the SSL client cert into the 'Personal' store of the Local Computer (thru the mmc).
STEP 3: I exported the client cert (without exporting the private keys) into a DER encoded .CER file.

Code:
1: I used X509Certificate.CreateFromCertFile() to create a X509Certificate object from the .CER file created in STEP 3 above.
2: I added this cert to the HttpWebRequest using httpRequest.ClientCertificates.Add(cert);


However the cert is not being sent to the web service.

No, if in STEP 2, I import the SSL client cert into the 'Personal' store of the Current User (and remove it from the the 'Personal' store of the Local Computer), then eveything works fine and the client cert is successfully sent to the web service (note:
the server cert is still in the Local Computer store).

The reason I need the client and server certs in the Local Computer stores is because I need to put this client into an ASP.NET web page.

I had read somewhere that the problem of HttpWebRequest not looking for certs in the Local Computer stores was fixed in the latest release of the .NET framework.

Am I missing something or does HttpWebRequest look into Local Computer only for the server cert and not to pickup the client certs?

Thanks,
Hari

  #2  
Old 05-27-04, 01:05 PM
dsergovic dsergovic is offline
Junior Member
Join Date: May 2004
Re: HttpWebRequest and SSL client certs in the 'Local Computer' store
Hari,

I'm having a similar problem using HttpWebRequest and a client certificate. I know the cert is on the machine properly b/c when I go to my https URL I get a formatted error response from the server (so I know I'm reaching them and they are processing the request.)

Have you had any luck since you posted this?

Dave



Quote:
Originally posted by Hari
Hi,

I am using the .NET faremework 1.1 (v1.1.4322). I have a web service client that does not use WSE 2.0 but uses HttpWebRequest directly. The web service itself requires SSL client auth.

Setup:
STEP 1: I imported the SSL server cert into the 'Trusted Rooot CAs' store of the Local Computer (thru the mmc).
STEP 2: I imported the SSL client cert into the 'Personal' store of the Local Computer (thru the mmc).
STEP 3: I exported the client cert (without exporting the private keys) into a DER encoded .CER file.

Code:
1: I used X509Certificate.CreateFromCertFile() to create a X509Certificate object from the .CER file created in STEP 3 above.
2: I added this cert to the HttpWebRequest using httpRequest.ClientCertificates.Add(cert);


However the cert is not being sent to the web service.

No, if in STEP 2, I import the SSL client cert into the 'Personal' store of the Current User (and remove it from the the 'Personal' store of the Local Computer), then eveything works fine and the client cert is successfully sent to the web service (note:
the server cert is still in the Local Computer store).

The reason I need the client and server certs in the Local Computer stores is because I need to put this client into an ASP.NET web page.

I had read somewhere that the problem of HttpWebRequest not looking for certs in the Local Computer stores was fixed in the latest release of the .NET framework.

Am I missing something or does HttpWebRequest look into Local Computer only for the server cert and not to pickup the client certs?

Thanks,
Hari
 


Popular forums
A+ (A Plus) Windows 2000 Active directory Exchange 2000 information store
Network+ Windows XP Security Exchange 2000 server administration
MCSE .NET Web services SQL Server
Cisco certification ASP .NET SQL 2000 Programming
Windows 2000 Registry .NET XML Viruses


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:12 AM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright MCSE braindumps 2003-2006