1

Have a webservice call from within a c# windows service. Service is behind an SSL cert. Certificate was registered into trusted root (password provided by provider).

Problem is that from the development machine verything works perfectly but once deployed onto production server, we keep on getting a 403 error.

Can browse to the service on the server, but get a cert popup?

No proxy, firewall fine, direct connection out.

Any suggestions?

0

2 Answers 2

2

If you're getting a 403, that most likely means that the server is expecting some kind of credentials, and if you get a cert popup in your browser that most likely means that those credentials are a client certificate. (A 403 could also mean that the server doesn't like you for some other reason, like IP address, but given the circumstances this seems less likely.)

Assuming the service wants a client certificate, you would need to explicitly associate the client certificate with the call either through code or in your configuration file. (How you go about this would depend on whether you're using WCF or classic Web Reference web services.)

It sounds like the certificate you were given by the provider might be the client certificate the service is looking for. If so, it would need to go into the "My" store for LocalMachine rather than Trusted Roots (because a client certificate isn't going to be a root certificate), and you would need to configure your code to use it in the request.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the answer. Problem seemed to be that we were trying to import the public key file and not the cert. Porblem was resolved by exporting the PK file as a cert and importing it to the trusted root.
1

You also need to add

ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; 

if you get "cannot create trust relationship" crap message!

1 Comment

hi.. do i need to add this code where web service call is initiated or at the web site serving the services...?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.