Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > SSL certificate validation fails in windows service

Thread Tools

SSL certificate validation fails in windows service

Oddmar Sandvik
Posts: n/a
Using .NET framework v1.1.4322.

My application connects up to a server using HttpWebRequest over SSL. The server certificate is selfsigned, and the CA certificate is installed on the client in Trusted Root Certification Authorities on the Local Computer account.

When I run the client application standalone, SSL communications work fine. However, when I install it as a service, the certificate cannot be validated. I override the ICertificatePolicy interface and receive an error code (0) that does not match any of the ones I have found in various examples.

I have tried with the service running both as LocalSystem (preferred) or as the same local user that I used when testing the application as a non-service. The result is the same - failure in both cases. I must resort to ignoring certificate validation. That is not an acceptable solution since there is no server authentication.

It appears that I cannot access the certificate store through .NET APIs without using P/Invoke against CryptoAPI, something I would prefer to stay away from. Thus I cannot see the CA certificates from my application.

Can anyone shed a light on why the .NET framework behaves differently when running as a service?
Reply With Quote

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Obtaining SSL certificate info from SSL object - BUG? John Nagle Python 11 12-14-2006 11:31 PM
Visual Studio 2005, SSL, Certificate validation ASP .Net Security 1 05-10-2006 09:23 AM
SSL / Web Service requring client certificates. No certificate server side...? Matthew ASP .Net Security 0 11-02-2004 11:44 AM
Certificate validation using Sun security provider fails DOD PKI tests! Java Developer Java 0 06-21-2004 10:45 PM
Generating SSL certificate fails in C3005 Mikko Cisco 1 01-13-2004 04:44 PM