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.
Add the following to your code, this sets your runtime to accept the SSL/TLS connection.
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With