How to resolve "The SSL connection could not be established" error in Azure Functions

Enzo Peralta 0 Reputation points
2024-01-09T15:21:30.12+00:00

I have an Azure Function that interacts with SAP via the OData service. There are instances where function executions would encounter the following error: The SSL connection could not be established.

Unfortunately, this does not happen in a predictable manner so replicating the issue has become a challenge as well.

We have also included the following code in our Program.cs file:

.ConfigurePrimaryHttpMessageHandler(() =>
		{
			return new HttpClientHandler()
			{
				ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => { return true; }
			};
		});
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Claudia Dos Santos Haz (CONCENTRIX CORPORATION) 1,120 Reputation points Microsoft External Staff
    2024-01-10T16:46:21.2333333+00:00

    Hello @Enzo Peralta,

    Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    I understand you are facing an issue with a standard logic app that has an HTTP call to an Azure Function. The HTTP call was working before but suddenly failed and raised an error The SSL connection could not be established.

    Plan 1:

    Could you please confirm if you have downloaded and saved the full path certificates (root, intermediate, cert) locally, then upload the 3 certificate to Public Key Certificates in logic app standard as below.

    User's image

    Then we need to add 3 thumbprints on WEBSITE_LOAD_ROOT_CERTIFICATES key, as comma separated as below:

    User's image

    The public key of the certificate must have been uploaded to Logic App as well. This is documented in the official documentation

    Plan 2:

    If the Storage Account is within a firewall, check that the VNET/Subnet that's associated with the Logic App is whitelisted on the Storage Account

    • Check in App Settings
    • Add WEBSITE_CONTENTOVERVNETwith Value 1

    Plan 3:

    Please follow the steps mentioned in this article.

    Hope this helps. If you still encounter the issue after following all the above, please do let me know. I would be happy to assist you further.

    Best regards,

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.