Impersonate to attach SSL certificate
From: ashwani tyagi (tashwani@yahoo.com)
Date: 08/23/02
- Next message: Howard Dierking: "memory cache"
- Previous message: Faisal Rahman: "encrypt the userid and password"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "ashwani tyagi" <tashwani@yahoo.com> Date: Fri, 23 Aug 2002 12:29:10 -0700
Hi,
1. I m able to attach a certificate to my webrequest and
send it successfully and get back the result -> IF I run
the asp.net worker process under the Administrator account
(by changing the processModel setting in my machine.config
file)
Here is my problem:
2. Next I try 2 impersonate(in the web.config file) the
Administrator account on my machine for the ASPNET user
account. The impersonate part works(i.e the asp.net
client process is working under Administrator account)
but when I try 2 send the certificate with my
HttpWebRequest it fails to authenticate the request. Here
is the code
Pls Note: This same code is working as described in 1
above under the Administrator account.
//attach the
certificate
X509Certificate cert;
cert = X509Certificate.CreateFromCertFile(certificate);
oWebRequest.ClientCertificates.Add(cert);
//Now write the data to the stream
[red]RequestStream = oWebRequest.GetRequestStream();[/red]
The code fails at the above line when using impersonation
and I get the following error
[red][Win32Exception (0x80004005): The message received
was unexpected or badly formatted]
[WebException: The underlying connection was closed: Could
not establish secure channel for SSL/TLS.][/red]
Any help is welcome.
Thanks in advance,
Ashwani
- Next message: Howard Dierking: "memory cache"
- Previous message: Faisal Rahman: "encrypt the userid and password"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|