The SSL connection could not be established, see inner exception

NeidennX 1 Reputation point
2022-01-24T22:16:03.5+00:00

Hi team, so im creating this app using Foursquare's Places API, everything seems good, but im not able to get the values from the API to the JSon variable, since when debbugin the app shows the attached error on the line before the Json (Line 23)

"The SSL connection could not be established, see inner exception"

Inner Exception says the following:

"Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED
at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/boringssl/ssl/handshake_client.c:1132"

I've tried using the next line of code on top of the method

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

I've also tried:

client.RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;

But this last one is not recognizng the RemoteCertificateValidationCallback method, can some one please help ? Here's the code im using for the client

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




            List<Result> venues = new List<Result>();

            var url = VenueRoot.GenerateUrl(Latitude, Longitude);


            RestClient client = new RestClient(url);



            var request = new RestRequest(Method.Get.ToString());



            request.AddHeader("Accept", "application/json");

            request.AddHeader("Authorization", Constants.HEADER);

            RestResponse response = await client.ExecuteAsync(request);

            var json = response.Content.ToString();
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,293 questions
Microsoft Partner Center API
Microsoft Partner Center API
Microsoft Partner Center: A Microsoft website for partners that provides access to product support, a partner community, and other partner services.API: A software intermediary that allows two applications to interact with each other.
313 questions
{count} votes

1 answer

Sort by: Most helpful
  1. sajan alex 0 Reputation points
    2023-05-12T16:31:43.4733333+00:00

    I have the same issue and it resolved with a simple change in the Application pool setting by changing LoadUserProfile to true.

    0 comments No comments