3
votes

Getting below error

Http Action - Request to host 'sipoc.cloudapp.net' failed: TrustFailure The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

while invoking below WCF RestService on https from Azure scheduler service GET job.

below is the webservice URL https://sipoc.cloudapp.net/Service1.svc/GetPlayersXMl

Service URL is working fine.

Any help would be appreciated.

2

2 Answers

1
votes

If I browse to the URL provided it indicates that the SSL certificate is not trusted.

"The security certificate presented by this website was not issued by a trusted certificate authority. The security certificate presented by this website has expired or is not yet valid. "

Scheduler jobs will fail as it can't trust the endpoint. You can either use a trusted certificate or just use HTTP (instead of HTTPS).

-1
votes

Although I would never recommend this in production unless you know the cert is valid (i.e. self signed), you can override the default behavior and confirm that the cert is good.

Below is a sample on how to do it in C#. There are a couple of ways to write it. The advantage here is that it remains SSL encrypted (versus falling back to HTTP).

ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;