SSL certificate validation fails in windows service

Discussion in 'ASP .Net Security' started by Oddmar Sandvik, Jun 17, 2004.

  1. 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?
    Oddmar Sandvik, Jun 17, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Java Developer
    Replies:
    0
    Views:
    567
    Java Developer
    Jun 21, 2004
  2. John Nagle
    Replies:
    11
    Views:
    631
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Dec 14, 2006
  3. Matthew
    Replies:
    0
    Views:
    377
    Matthew
    Nov 2, 2004
  4. Replies:
    1
    Views:
    349
    Dominick Baier [DevelopMentor]
    May 10, 2006
  5. Helena Cai
    Replies:
    0
    Views:
    394
    Helena Cai
    Aug 29, 2004
Loading...

Share This Page