Click here to Skip to main content
15,884,050 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I get the following exception when accessing a Web Service in a Windows service.

System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

The same code is running well as a console application. The service logs in with the LocalSystem (different from the development user). The certificate source is in the Trusted Root Certification Authorities list. I use Windows XP.

What can I do to solve this problem?

Thank in advance.

Regards,
KeesGijs
Posted
Updated 12-Feb-10 6:38am
v2

KeesDekker wrote:
The same code is running well as a console application. The service logs in with the LocalSystem (different from the development user). The certificate source is in the Trusted Root Certification Authorities list.


Does the LocalSystem-account have a valid certificate to perform a login? If it's run under a different account, then it would also try to access the certificate-store that belongs to that user-account.

--edit--
It's suggested here[^] that the LocalSystem account doesn't have access to the certificate store. Does the service have to run on a limited account, or would it be acceptable to run it using a local useraccount?
 
Share this answer
 
v2
Thanks Eddy.
I understood that certificates in the Trusted Root Certification Authorities tab are valid for any login on my PC.
Is that true?
If not, how do I make a certificate valid for the LocalSystem login in particular?
Regards,
Kees
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900