79412690

Date: 2025-02-04 18:33:33
Score: 1
Natty:
Report link

After some digging, I found that the app refuses the connection to my api due to self signed certificates. I needed to add a flag to accept the connection:

public static RestClient GetMobileAPIClient()
    {
      HttpClientHandler handler = new HttpClientHandler();

#if DEBUG
      handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) =>
      {
        if (cert != null && cert.Issuer.Equals("CN=localhost"))
          return true;
        return errors == System.Net.Security.SslPolicyErrors.None;
      };
#endif

      HttpClient client = new HttpClient(handler);
      client.BaseAddress = new Uri(Constants.MobileAPIURI);

      return new RestClient(client);
    }

As for the ping that never returned anything, I found out that a ping always times out in an Android VM, unless you call a java operation directly.

Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: MyselfAndOnlyMe