Impersonate to attach SSL certificate

From: ashwani tyagi (tashwani@yahoo.com)
Date: 08/23/02


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



Relevant Pages

  • Re: Publishing Windows Server 2003 Certificates in Win2k Active Directory
    ... The administrator account is special in that the CA cannot write to the ... > I've installed an Enterprise CA on a Windows Server 2003 (RTM, ... > The CA computer account is a member of the "Cert Publishers" group. ... > Certificate Services could not publish a Certificate for request 10 to the ...
    (microsoft.public.win2000.security)
  • Re: How to add EFS data recovery agents on Windows 2000 workgroup server
    ... I found if I first export the original RA certificate and private ... import the original certificate/private key from the .pfx file. ... both for the built in administrator account. ... > completed all the steps and logged on with new recovery agent I ...
    (microsoft.public.win2000.security)
  • Re: EFS nightmare
    ... You need to have a domain environment in order to ... access EFS files stored on a remote computer. ... > one of the 3 pcs is the server and uses the built-in administrator account ... > login in as built-in administrator and install the certificate again ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Cannot Decrypt Files
    ... The certificate that says you have the private key for, ... When you try to import a certificate/private key for EFS, ... while logged on as the built in administrator account, ...
    (microsoft.public.win2000.security)
  • Re: ADFS Token-signing Certs Not in Trusted Root Store
    ... This is good info, Joe. ... So now I know that the token-signing certificate is ... Get a signing cert from a CA ... case, you never have to worry about expiration or CRL checking, as your cert ...
    (microsoft.public.windows.server.active_directory)