SSL connection could not be established with .Net HttpClient

wrappingduke 21 Reputation points
2023-09-22T00:20:37.9133333+00:00

Hi,

Attempting to make api calls to Yelp Fusion via .Net 3.1 api but receiving the following error:

Error Message: The SSL connection could not be established, see inner exception. Source: System.Net.Http Trace: at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore

Of course, the api call to Fusion from localhost runs fine. This appears to be a cipher issue??

Also, attempted to bypass the certificate with the following code:

HttpClientHandler clientHandler = new HttpClientHandler();
clientHandler.ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => cert.Verify(); //{ return true; };
using (HttpClient httpClient = new HttpClient(clientHandler)) {....

Any insight on how to resolve would be greatly appreciated

Developer technologies ASP.NET ASP.NET Core
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2023-09-22T03:44:40.2866667+00:00

    if it runs from localhost, then most likely its a firewall issue on the deployed host.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

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.