error with System.Net.WebClient when in a service  
Author Message
Anarchy





PostPosted: .NET Framework Networking and Communication, error with System.Net.WebClient when in a service Top

Hi,

I have an app which uses HTTP Post to send data. This worked fine when in an app, and I've now ported it to a service, the core porcessing is the same.

However, the UploadData method is now coming back with the following error:

WEBex:The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel., InnerEx:The remote certificate is invalid according to the validation procedure.

Any ideas why this should work in an app, but not in a {LocalSystem} windows service



.NET Development37  
 
 
RizwanSharp





PostPosted: .NET Framework Networking and Communication, error with System.Net.WebClient when in a service Top

Under which Account you Ran The service. It seems like Authentication Error, Run Server from User Account under which you ran Application and see what happens

I hope this will solve your problem.

Best Regards,



 
 
Anarchy





PostPosted: .NET Framework Networking and Communication, error with System.Net.WebClient when in a service Top

Thanks Rizwan,

it turns out I had a certificate installed under my user