A few questions:
1. Do both the console and service calls attempt to connect to the exact
same URL (incl. use of https protocol)?
2. Are both the console and service run from the same machine?
3. Are both the console and service run under the same Windows user
account?
(If the answer to any of the above is "no", please provide details on the
differences.)
4. Does the target server require that a client certificate be provided?
> The code with this call works fine when hosted in a Console application,
> but
[quoted text clipped - 5 lines]
> I have spent almost the whole day reading about security, attributes, etc.
> but I just can't get this to work.
FloridaCoder - 28 Jul 2005 13:02 GMT
1. Yes, both apps execute the exact same code.
2. Yes.
3. The console program, I assume, uses my logged on user account, the
windows service uses the LocalSystem account. I will experiment with having
it use my user account.
4. Yes, a simple certificate that I installed in IE. I don't do anything in
my code to reference this certificate so I don't know why it works for the
console app and not the Window Service.
> A few questions:
>
[quoted text clipped - 18 lines]
> > I have spent almost the whole day reading about security, attributes, etc.
> > but I just can't get this to work.
FloridaCoder - 28 Jul 2005 13:17 GMT
I changed the service user to my logon user and it works.
Thanks so much for getting me pointed in the right direction.
If you can give me some pointers of what permission is involved that my user
logon has that LocalSystem doesn't and how I can change LocalSystem, that
would be great.
Again, thanks
> A few questions:
>
[quoted text clipped - 18 lines]
> > I have spent almost the whole day reading about security, attributes, etc.
> > but I just can't get this to work.
Nicole Calinoiu - 28 Jul 2005 14:07 GMT
It probably has nothing to do with permissions. When you installed the
client certificate via IE, you were placing it in a user-specific store.
The LocalSystem account doesn't have a corresponding certificate, so its
requests fail. See
http://msdn.microsoft.com/library/en-us/dnnetsec/html/secnetht13.asp for
more information and instructions on how to use the machine store rather
than a user-level store. (N.B.: You can also use the MMC certificates
snap-in to manage the certificate store.)
>I changed the service user to my logon user and it works.
>
[quoted text clipped - 32 lines]
>> > etc.
>> > but I just can't get this to work.