R
Raphael Gray
Summary:
I am accessing a remote web service as a client and passing a client
certificate as part of a call. The client certificate works perfectly when
checking via a local user account to access the data. It also works on my
local PC. On the Windows 2003 Server it is failing. I have tried several
options as outlined below to make this work.
Environment:
Windows Server 2003 SP3, .Net 2.0.50727, IIS 6.0
Application:
C# .Net web page. This is calling the WebService via a proxy and using the
WSE 3.0 classes to get the certificate.
Certificate:
The certificate is an X509 pfx that includes the private key and works fine
from a local user account.
Code Sample:
//Certificate Collection Location where certificate is gathered from
X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine)
//Request
Proxy myProxy = new Proxy();
myProxy.ClientCertificates.Add(signatureToken.Certificate)
string myResult = myProxy.Execute(xmlString)
Error: I then receive a WebException as: The request failed with HTTP
status 403: Forbidden.
Setup/Attempted Solutions:
1. Ensured that the certificate includes the private key
(signatureToken.Certificate.HasPrivateKey).
2. Ensured that the Security needed should be the NT Authority\Network
Service Account.
3. Ensured that the Certificate was in the Local Machine Store Personal
Certificates Repository. (using MMC - Certificates Add-In - Ensured this
was added to the local machine store - Personal Folder).
4. Used WinHttpCertCfg.exe to ensure that needed accounts should have
authority to the certificate: ("C:\Program Files\Windows Resource
Kits\Tools\WinHttpCertCfg.exe" -g -c LOCAL_MACHINE\MY -s "CertName" -a
"Server\NETWORK SERVICE") (Confirmation using -l method: Additional
accounts and groups with access to the private key include:
BUILTIN\Administrators
NT AUTHORITY\SYSTEM
NT AUTHORITY\NETWORK SERVICE)
I also have tried adding the ASPNet and IUSR_MACHINE securities for this.
This seems to have followed all the instructions I have seen and I have
combed the posts for several hours looking for a resolution. Sorry about the
glut of info, but I wanted to ensure that steps already taken were known.
I'm sorry about any posting etiquette issues as well as I post very
infrequently.
Thanks
I am accessing a remote web service as a client and passing a client
certificate as part of a call. The client certificate works perfectly when
checking via a local user account to access the data. It also works on my
local PC. On the Windows 2003 Server it is failing. I have tried several
options as outlined below to make this work.
Environment:
Windows Server 2003 SP3, .Net 2.0.50727, IIS 6.0
Application:
C# .Net web page. This is calling the WebService via a proxy and using the
WSE 3.0 classes to get the certificate.
Certificate:
The certificate is an X509 pfx that includes the private key and works fine
from a local user account.
Code Sample:
//Certificate Collection Location where certificate is gathered from
X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine)
//Request
Proxy myProxy = new Proxy();
myProxy.ClientCertificates.Add(signatureToken.Certificate)
string myResult = myProxy.Execute(xmlString)
Error: I then receive a WebException as: The request failed with HTTP
status 403: Forbidden.
Setup/Attempted Solutions:
1. Ensured that the certificate includes the private key
(signatureToken.Certificate.HasPrivateKey).
2. Ensured that the Security needed should be the NT Authority\Network
Service Account.
3. Ensured that the Certificate was in the Local Machine Store Personal
Certificates Repository. (using MMC - Certificates Add-In - Ensured this
was added to the local machine store - Personal Folder).
4. Used WinHttpCertCfg.exe to ensure that needed accounts should have
authority to the certificate: ("C:\Program Files\Windows Resource
Kits\Tools\WinHttpCertCfg.exe" -g -c LOCAL_MACHINE\MY -s "CertName" -a
"Server\NETWORK SERVICE") (Confirmation using -l method: Additional
accounts and groups with access to the private key include:
BUILTIN\Administrators
NT AUTHORITY\SYSTEM
NT AUTHORITY\NETWORK SERVICE)
I also have tried adding the ASPNet and IUSR_MACHINE securities for this.
This seems to have followed all the instructions I have seen and I have
combed the posts for several hours looking for a resolution. Sorry about the
glut of info, but I wanted to ensure that steps already taken were known.
I'm sorry about any posting etiquette issues as well as I post very
infrequently.
Thanks