I have Web Job and Web API running on same Web App in Azure. Web Job access Web API over Https. But it throws below error while trying to access Web API:
An error occurred while sending the request. The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Adding following code to webjob on startup solved the issue.
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;